mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 00:16:23 +02:00
improve octree stats display
This commit is contained in:
parent
c09b5aec5e
commit
12becb9d19
5 changed files with 152 additions and 45 deletions
|
@ -157,9 +157,9 @@ void OctreeStatsDialog::paintEvent(QPaintEvent* event) {
|
||||||
|
|
||||||
statsValue.str("");
|
statsValue.str("");
|
||||||
statsValue <<
|
statsValue <<
|
||||||
"Total: " << localTotalString.toLocal8Bit().constData() << " / " <<
|
"Total: " << qPrintable(localTotalString) << " / " <<
|
||||||
"Internal: " << localInternalString.toLocal8Bit().constData() << " / " <<
|
"Internal: " << qPrintable(localInternalString) << " / " <<
|
||||||
"Leaves: " << localLeavesString.toLocal8Bit().constData() << "";
|
"Leaves: " << qPrintable(localLeavesString) << "";
|
||||||
label->setText(statsValue.str().c_str());
|
label->setText(statsValue.str().c_str());
|
||||||
|
|
||||||
// iterate all the current voxel stats, and list their sending modes, total their voxels, etc...
|
// iterate all the current voxel stats, and list their sending modes, total their voxels, etc...
|
||||||
|
@ -212,9 +212,9 @@ void OctreeStatsDialog::paintEvent(QPaintEvent* event) {
|
||||||
label = _labels[_serverVoxels];
|
label = _labels[_serverVoxels];
|
||||||
statsValue.str("");
|
statsValue.str("");
|
||||||
statsValue <<
|
statsValue <<
|
||||||
"Total: " << serversTotalString.toLocal8Bit().constData() << " / " <<
|
"Total: " << qPrintable(serversTotalString) << " / " <<
|
||||||
"Internal: " << serversInternalString.toLocal8Bit().constData() << " / " <<
|
"Internal: " << qPrintable(serversInternalString) << " / " <<
|
||||||
"Leaves: " << serversLeavesString.toLocal8Bit().constData() << "";
|
"Leaves: " << qPrintable(serversLeavesString) << "";
|
||||||
label->setText(statsValue.str().c_str());
|
label->setText(statsValue.str().c_str());
|
||||||
|
|
||||||
showAllOctreeServers();
|
showAllOctreeServers();
|
||||||
|
@ -290,7 +290,7 @@ void OctreeStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t ser
|
||||||
AABox serverBounds(glm::vec3(rootDetails.x, rootDetails.y, rootDetails.z), rootDetails.s);
|
AABox serverBounds(glm::vec3(rootDetails.x, rootDetails.y, rootDetails.z), rootDetails.s);
|
||||||
serverBounds.scale(TREE_SCALE);
|
serverBounds.scale(TREE_SCALE);
|
||||||
serverDetails << " jurisdiction: "
|
serverDetails << " jurisdiction: "
|
||||||
<< rootCodeHex.toLocal8Bit().constData()
|
<< qPrintable(rootCodeHex)
|
||||||
<< " ["
|
<< " ["
|
||||||
<< rootDetails.x << ", "
|
<< rootDetails.x << ", "
|
||||||
<< rootDetails.y << ", "
|
<< rootDetails.y << ", "
|
||||||
|
@ -320,8 +320,8 @@ void OctreeStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t ser
|
||||||
QString lastFullSendString = locale.toString(lastFullSend);
|
QString lastFullSendString = locale.toString(lastFullSend);
|
||||||
|
|
||||||
extraDetails << "<br/>" << "Last Full Scene... " <<
|
extraDetails << "<br/>" << "Last Full Scene... " <<
|
||||||
"Encode Time: " << lastFullEncodeString.toLocal8Bit().constData() << " ms " <<
|
"Encode Time: " << qPrintable(lastFullEncodeString) << " ms " <<
|
||||||
"Send Time: " << lastFullSendString.toLocal8Bit().constData() << " ms ";
|
"Send Time: " << qPrintable(lastFullSendString) << " ms ";
|
||||||
|
|
||||||
for (int i = 0; i < OctreeSceneStats::ITEM_COUNT; i++) {
|
for (int i = 0; i < OctreeSceneStats::ITEM_COUNT; i++) {
|
||||||
OctreeSceneStats::Item item = (OctreeSceneStats::Item)(i);
|
OctreeSceneStats::Item item = (OctreeSceneStats::Item)(i);
|
||||||
|
@ -334,42 +334,51 @@ void OctreeStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t ser
|
||||||
QString internalString = locale.toString((uint)stats.getTotalInternal());
|
QString internalString = locale.toString((uint)stats.getTotalInternal());
|
||||||
QString leavesString = locale.toString((uint)stats.getTotalLeaves());
|
QString leavesString = locale.toString((uint)stats.getTotalLeaves());
|
||||||
|
|
||||||
serverDetails << "<br/>" << "Node UUID: " <<
|
serverDetails << "<br/>" << "Node UUID: " << qPrintable(nodeUUID.toString()) << " ";
|
||||||
nodeUUID.toString().toLocal8Bit().constData() << " ";
|
|
||||||
|
|
||||||
serverDetails << "<br/>" << "Voxels: " <<
|
serverDetails << "<br/>" << "Voxels: " <<
|
||||||
totalString.toLocal8Bit().constData() << " total " <<
|
qPrintable(totalString) << " total " <<
|
||||||
internalString.toLocal8Bit().constData() << " internal " <<
|
qPrintable(internalString) << " internal " <<
|
||||||
leavesString.toLocal8Bit().constData() << " leaves ";
|
qPrintable(leavesString) << " leaves ";
|
||||||
|
|
||||||
QString incomingPacketsString = locale.toString((uint)stats.getIncomingPackets());
|
QString incomingPacketsString = locale.toString((uint)stats.getIncomingPackets());
|
||||||
QString incomingBytesString = locale.toString((uint)stats.getIncomingBytes());
|
QString incomingBytesString = locale.toString((uint)stats.getIncomingBytes());
|
||||||
QString incomingWastedBytesString = locale.toString((uint)stats.getIncomingWastedBytes());
|
QString incomingWastedBytesString = locale.toString((uint)stats.getIncomingWastedBytes());
|
||||||
QString incomingOutOfOrderString = locale.toString((uint)stats.getIncomingOutOfOrder());
|
QString incomingOutOfOrderString = locale.toString((uint)stats.getIncomingOutOfOrder());
|
||||||
|
QString incomingLateString = locale.toString((uint)stats.getIncomingLate());
|
||||||
|
QString incomingReallyLateString = locale.toString((uint)stats.getIncomingReallyLate());
|
||||||
|
QString incomingEarlyString = locale.toString((uint)stats.getIncomingEarly());
|
||||||
QString incomingLikelyLostString = locale.toString((uint)stats.getIncomingLikelyLost());
|
QString incomingLikelyLostString = locale.toString((uint)stats.getIncomingLikelyLost());
|
||||||
|
QString incomingRecovered = locale.toString((uint)stats.getIncomingRecovered());
|
||||||
|
QString incomingDuplicateString = locale.toString((uint)stats.getIncomingPossibleDuplicate());
|
||||||
|
|
||||||
int clockSkewInMS = node->getClockSkewUsec() / (int)USECS_PER_MSEC;
|
int clockSkewInMS = node->getClockSkewUsec() / (int)USECS_PER_MSEC;
|
||||||
QString incomingFlightTimeString = locale.toString((int)stats.getIncomingFlightTimeAverage());
|
QString incomingFlightTimeString = locale.toString((int)stats.getIncomingFlightTimeAverage());
|
||||||
QString incomingPingTimeString = locale.toString(node->getPingMs());
|
QString incomingPingTimeString = locale.toString(node->getPingMs());
|
||||||
QString incomingClockSkewString = locale.toString(clockSkewInMS);
|
QString incomingClockSkewString = locale.toString(clockSkewInMS);
|
||||||
|
|
||||||
serverDetails << "<br/>" << "Incoming Packets: " <<
|
serverDetails << "<br/>" << "Incoming Packets: " << qPrintable(incomingPacketsString) <<
|
||||||
incomingPacketsString.toLocal8Bit().constData() <<
|
"/ Lost: " << qPrintable(incomingLikelyLostString) <<
|
||||||
" Out of Order: " << incomingOutOfOrderString.toLocal8Bit().constData() <<
|
"/ Recovered: " << qPrintable(incomingRecovered);
|
||||||
" Likely Lost: " << incomingLikelyLostString.toLocal8Bit().constData();
|
|
||||||
|
serverDetails << "<br/>" << " Out of Order: " << qPrintable(incomingOutOfOrderString) <<
|
||||||
|
"/ Early: " << qPrintable(incomingEarlyString) <<
|
||||||
|
"/ Late: " << qPrintable(incomingLateString) <<
|
||||||
|
"/ Really Late: " << qPrintable(incomingReallyLateString) <<
|
||||||
|
"/ Duplicate: " << qPrintable(incomingDuplicateString);
|
||||||
|
|
||||||
serverDetails << "<br/>" <<
|
serverDetails << "<br/>" <<
|
||||||
" Average Flight Time: " << incomingFlightTimeString.toLocal8Bit().constData() << " msecs";
|
" Average Flight Time: " << qPrintable(incomingFlightTimeString) << " msecs";
|
||||||
|
|
||||||
serverDetails << "<br/>" <<
|
serverDetails << "<br/>" <<
|
||||||
" Average Ping Time: " << incomingPingTimeString.toLocal8Bit().constData() << " msecs";
|
" Average Ping Time: " << qPrintable(incomingPingTimeString) << " msecs";
|
||||||
|
|
||||||
serverDetails << "<br/>" <<
|
serverDetails << "<br/>" <<
|
||||||
" Average Clock Skew: " << incomingClockSkewString.toLocal8Bit().constData() << " msecs";
|
" Average Clock Skew: " << qPrintable(incomingClockSkewString) << " msecs";
|
||||||
|
|
||||||
serverDetails << "<br/>" << "Incoming" <<
|
serverDetails << "<br/>" << "Incoming" <<
|
||||||
" Bytes: " << incomingBytesString.toLocal8Bit().constData() <<
|
" Bytes: " << qPrintable(incomingBytesString) <<
|
||||||
" Wasted Bytes: " << incomingWastedBytesString.toLocal8Bit().constData();
|
" Wasted Bytes: " << qPrintable(incomingWastedBytesString);
|
||||||
|
|
||||||
serverDetails << extraDetails.str();
|
serverDetails << extraDetails.str();
|
||||||
if (_extraServerDetails[serverCount-1] == MORE) {
|
if (_extraServerDetails[serverCount-1] == MORE) {
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <fstream> // to load voxels from file
|
#include <fstream> // to load voxels from file
|
||||||
|
|
||||||
#include <glm/gtc/noise.hpp>
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "CoverageMap.h"
|
#include "CoverageMap.h"
|
||||||
|
|
|
@ -30,8 +30,13 @@ OctreeSceneStats::OctreeSceneStats() :
|
||||||
_incomingBytes(0),
|
_incomingBytes(0),
|
||||||
_incomingWastedBytes(0),
|
_incomingWastedBytes(0),
|
||||||
_incomingLastSequence(0),
|
_incomingLastSequence(0),
|
||||||
_incomingOutOfOrder(0),
|
|
||||||
_incomingLikelyLost(0),
|
_incomingLikelyLost(0),
|
||||||
|
_incomingRecovered(0),
|
||||||
|
_incomingEarly(0),
|
||||||
|
_incomingLate(0),
|
||||||
|
_incomingReallyLate(0),
|
||||||
|
_incomingPossibleDuplicate(0),
|
||||||
|
_missingSequenceNumbers(),
|
||||||
_incomingFlightTimeAverage(samples),
|
_incomingFlightTimeAverage(samples),
|
||||||
_jurisdictionRoot(NULL)
|
_jurisdictionRoot(NULL)
|
||||||
{
|
{
|
||||||
|
@ -134,8 +139,14 @@ void OctreeSceneStats::copyFromOther(const OctreeSceneStats& other) {
|
||||||
_incomingBytes = other._incomingBytes;
|
_incomingBytes = other._incomingBytes;
|
||||||
_incomingWastedBytes = other._incomingWastedBytes;
|
_incomingWastedBytes = other._incomingWastedBytes;
|
||||||
_incomingLastSequence = other._incomingLastSequence;
|
_incomingLastSequence = other._incomingLastSequence;
|
||||||
_incomingOutOfOrder = other._incomingOutOfOrder;
|
|
||||||
_incomingLikelyLost = other._incomingLikelyLost;
|
_incomingLikelyLost = other._incomingLikelyLost;
|
||||||
|
_incomingRecovered = other._incomingRecovered;
|
||||||
|
_incomingEarly = other._incomingEarly;
|
||||||
|
_incomingLate = other._incomingLate;
|
||||||
|
_incomingReallyLate = other._incomingReallyLate;
|
||||||
|
_incomingPossibleDuplicate = other._incomingPossibleDuplicate;
|
||||||
|
|
||||||
|
_missingSequenceNumbers = other._missingSequenceNumbers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -823,18 +834,95 @@ void OctreeSceneStats::trackIncomingOctreePacket(const QByteArray& packet,
|
||||||
float flightTimeMsecs = flightTime / USECS_PER_MSEC;
|
float flightTimeMsecs = flightTime / USECS_PER_MSEC;
|
||||||
_incomingFlightTimeAverage.updateAverage(flightTimeMsecs);
|
_incomingFlightTimeAverage.updateAverage(flightTimeMsecs);
|
||||||
|
|
||||||
|
// track out of order and possibly lost packets...
|
||||||
|
const bool wantExtraDebugging = false;
|
||||||
|
if (sequence == _incomingLastSequence) {
|
||||||
|
if (wantExtraDebugging) {
|
||||||
|
qDebug() << "last packet duplicate got:" << sequence << "_incomingLastSequence:" << _incomingLastSequence;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
OCTREE_PACKET_SEQUENCE expected = _incomingLastSequence+1;
|
||||||
|
if (sequence != expected) {
|
||||||
|
if (wantExtraDebugging) {
|
||||||
|
qDebug() << "out of order... got:" << sequence << "expected:" << expected;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if the sequence is less than our expected, then this might be a packet
|
||||||
|
// that was delayed and so we should find it in our lostSequence list
|
||||||
|
if (sequence < expected) {
|
||||||
|
if (wantExtraDebugging) {
|
||||||
|
qDebug() << "this packet is later than expected...";
|
||||||
|
}
|
||||||
|
if (sequence < std::max(0, (expected - MAX_MISSING_SEQUENCE_OLD_AGE))) {
|
||||||
|
_incomingReallyLate++;
|
||||||
|
} else {
|
||||||
|
_incomingLate++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_missingSequenceNumbers.contains(sequence)) {
|
||||||
|
if (wantExtraDebugging) {
|
||||||
|
qDebug() << "found it in _missingSequenceNumbers";
|
||||||
|
}
|
||||||
|
_missingSequenceNumbers.remove(sequence);
|
||||||
|
_incomingLikelyLost--;
|
||||||
|
_incomingRecovered++;
|
||||||
|
} else {
|
||||||
|
// if we're still in our pruning window, and we didn't find it in our missing list,
|
||||||
|
// than this is really unexpected and can probably only happen if the packet was a
|
||||||
|
// duplicate
|
||||||
|
if (sequence >= std::max(0, (expected - MAX_MISSING_SEQUENCE_OLD_AGE))) {
|
||||||
|
if (wantExtraDebugging) {
|
||||||
|
qDebug() << "sequence:" << sequence << "WAS NOT found in _missingSequenceNumbers, and not that old... (expected - MAX_MISSING_SEQUENCE_OLD_AGE):" << (expected - MAX_MISSING_SEQUENCE_OLD_AGE);
|
||||||
|
}
|
||||||
|
_incomingPossibleDuplicate++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sequence > expected) {
|
||||||
|
if (wantExtraDebugging) {
|
||||||
|
qDebug() << "this packet is earlier than expected...";
|
||||||
|
}
|
||||||
|
_incomingEarly++;
|
||||||
|
|
||||||
|
// hmm... so, we either didn't get some packets, or this guy came early...
|
||||||
|
unsigned int missing = sequence - expected;
|
||||||
|
if (wantExtraDebugging) {
|
||||||
|
qDebug() << ">>>>>>>> missing gap=" << missing;
|
||||||
|
}
|
||||||
|
_incomingLikelyLost += missing;
|
||||||
|
for(unsigned int missingSequence = expected; missingSequence < sequence; missingSequence++) {
|
||||||
|
_missingSequenceNumbers << missingSequence;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// only bump the last sequence if it was greater than our previous last sequence, this will keep us from
|
||||||
|
// accidentally going backwards when an out of order (recovered) packet comes in
|
||||||
|
if (sequence > _incomingLastSequence) {
|
||||||
|
_incomingLastSequence = sequence;
|
||||||
|
}
|
||||||
|
|
||||||
// detect out of order packets
|
// do some garbage collecting on our _missingSequenceNumbers
|
||||||
if (sequence < _incomingLastSequence) {
|
if (_missingSequenceNumbers.size() > MAX_MISSING_SEQUENCE) {
|
||||||
_incomingOutOfOrder++;
|
if (wantExtraDebugging) {
|
||||||
|
qDebug() << "too many _missingSequenceNumbers:" << _missingSequenceNumbers.size();
|
||||||
|
}
|
||||||
|
foreach(unsigned int missingItem, _missingSequenceNumbers) {
|
||||||
|
if (wantExtraDebugging) {
|
||||||
|
qDebug() << "checking item:" << missingItem << "is it in need of pruning?";
|
||||||
|
qDebug() << "(_incomingLastSequence - MAX_MISSING_SEQUENCE_OLD_AGE):"
|
||||||
|
<< (_incomingLastSequence - MAX_MISSING_SEQUENCE_OLD_AGE);
|
||||||
|
}
|
||||||
|
if (missingItem <= std::max(0, (_incomingLastSequence - MAX_MISSING_SEQUENCE_OLD_AGE))) {
|
||||||
|
if (wantExtraDebugging) {
|
||||||
|
qDebug() << "pruning really old missing sequence:" << missingItem;
|
||||||
|
}
|
||||||
|
_missingSequenceNumbers.remove(missingItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// detect likely lost packets
|
|
||||||
OCTREE_PACKET_SEQUENCE expected = _incomingLastSequence+1;
|
|
||||||
if (sequence > expected) {
|
|
||||||
_incomingLikelyLost++;
|
|
||||||
}
|
|
||||||
|
|
||||||
_incomingLastSequence = sequence;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,8 +159,13 @@ public:
|
||||||
unsigned int getIncomingPackets() const { return _incomingPacket; }
|
unsigned int getIncomingPackets() const { return _incomingPacket; }
|
||||||
unsigned long getIncomingBytes() const { return _incomingBytes; }
|
unsigned long getIncomingBytes() const { return _incomingBytes; }
|
||||||
unsigned long getIncomingWastedBytes() const { return _incomingWastedBytes; }
|
unsigned long getIncomingWastedBytes() const { return _incomingWastedBytes; }
|
||||||
unsigned int getIncomingOutOfOrder() const { return _incomingOutOfOrder; }
|
unsigned int getIncomingOutOfOrder() const { return _incomingLate + _incomingEarly; }
|
||||||
unsigned int getIncomingLikelyLost() const { return _incomingLikelyLost; }
|
unsigned int getIncomingLikelyLost() const { return _incomingLikelyLost; }
|
||||||
|
unsigned int getIncomingRecovered() const { return _incomingRecovered; }
|
||||||
|
unsigned int getIncomingEarly() const { return _incomingEarly; }
|
||||||
|
unsigned int getIncomingLate() const { return _incomingLate; }
|
||||||
|
unsigned int getIncomingReallyLate() const { return _incomingReallyLate; }
|
||||||
|
unsigned int getIncomingPossibleDuplicate() const { return _incomingPossibleDuplicate; }
|
||||||
float getIncomingFlightTimeAverage() { return _incomingFlightTimeAverage.getAverage(); }
|
float getIncomingFlightTimeAverage() { return _incomingFlightTimeAverage.getAverage(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -251,9 +256,18 @@ private:
|
||||||
unsigned int _incomingPacket;
|
unsigned int _incomingPacket;
|
||||||
unsigned long _incomingBytes;
|
unsigned long _incomingBytes;
|
||||||
unsigned long _incomingWastedBytes;
|
unsigned long _incomingWastedBytes;
|
||||||
unsigned int _incomingLastSequence;
|
|
||||||
unsigned int _incomingOutOfOrder;
|
const uint16_t MAX_MISSING_SEQUENCE = 100; /// how many items in our _missingSequenceNumbers before we start to prune them
|
||||||
unsigned int _incomingLikelyLost;
|
const uint16_t MAX_MISSING_SEQUENCE_OLD_AGE = 1000; /// age we allow items in _missingSequenceNumbers to be before pruning
|
||||||
|
|
||||||
|
uint16_t _incomingLastSequence; /// last incoming sequence number
|
||||||
|
unsigned int _incomingLikelyLost; /// count of packets likely lost, may be off by _incomingReallyLate count
|
||||||
|
unsigned int _incomingRecovered; /// packets that were late, and we had in our missing list, we consider recovered
|
||||||
|
unsigned int _incomingEarly; /// out of order earlier than expected
|
||||||
|
unsigned int _incomingLate; /// out of order later than expected
|
||||||
|
unsigned int _incomingReallyLate; /// out of order and later than MAX_MISSING_SEQUENCE_OLD_AGE late
|
||||||
|
unsigned int _incomingPossibleDuplicate; /// out of order possibly a duplicate
|
||||||
|
QSet<unsigned int> _missingSequenceNumbers;
|
||||||
SimpleMovingAverage _incomingFlightTimeAverage;
|
SimpleMovingAverage _incomingFlightTimeAverage;
|
||||||
|
|
||||||
// features related items
|
// features related items
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include <glm/gtc/noise.hpp>
|
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QRgb>
|
#include <QRgb>
|
||||||
|
|
Loading…
Reference in a new issue