mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 19:23:58 +02:00
add a bunch more stats for avatar processing
This commit is contained in:
parent
41dc498888
commit
ae071aec0d
6 changed files with 44 additions and 3 deletions
|
@ -105,6 +105,14 @@ Item {
|
|||
visible: root.expanded
|
||||
text: "Asset Mbps In/Out: " + root.assetMbpsIn.toFixed(2) + "/" + root.assetMbpsOut.toFixed(2)
|
||||
}
|
||||
StatText {
|
||||
visible: root.expanded
|
||||
text: "Fully Simulated Avatars: " + root.fullySimulatedAvatarCount
|
||||
}
|
||||
StatText {
|
||||
visible: root.expanded
|
||||
text: "Partially Simulated Avatars: " + root.partiallySimulatedAvatarCount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -217,7 +225,10 @@ Item {
|
|||
text: " Batch: " + root.batchFrameTime.toFixed(1) + " ms"
|
||||
}
|
||||
StatText {
|
||||
text: " GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
|
||||
text: " GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
|
||||
}
|
||||
StatText {
|
||||
text: " Avatar: " + root.avatarSimulationTime.toFixed(1) + " ms"
|
||||
}
|
||||
StatText {
|
||||
text: "Triangles: " + root.triangles +
|
||||
|
|
|
@ -230,6 +230,9 @@ void AvatarManager::updateOtherAvatars(float deltaTime) {
|
|||
const uint64_t MAX_UPDATE_BUDGET = 2000; // usec
|
||||
uint64_t renderExpiry = startTime + RENDER_UPDATE_BUDGET;
|
||||
uint64_t maxExpiry = startTime + MAX_UPDATE_BUDGET;
|
||||
|
||||
int fullySimulatedAvatars = 0;
|
||||
int partiallySimulatedAvatars = 0;
|
||||
while (!sortedAvatars.empty()) {
|
||||
const AvatarPriority& sortData = sortedAvatars.top();
|
||||
const auto& avatar = std::static_pointer_cast<Avatar>(sortData.avatar);
|
||||
|
@ -258,6 +261,7 @@ void AvatarManager::updateOtherAvatars(float deltaTime) {
|
|||
avatar->simulate(deltaTime, inView);
|
||||
avatar->updateRenderItem(pendingChanges);
|
||||
avatar->setLastRenderUpdateTime(startTime);
|
||||
fullySimulatedAvatars++;
|
||||
} else if (now < maxExpiry) {
|
||||
// we've spent most of our time budget, but we still simulate() the avatar as it if were out of view
|
||||
// --> some avatars may freeze until their priority trickles up
|
||||
|
@ -271,6 +275,14 @@ void AvatarManager::updateOtherAvatars(float deltaTime) {
|
|||
}
|
||||
sortedAvatars.pop();
|
||||
}
|
||||
|
||||
uint64_t endSimulation = usecTimestampNow();
|
||||
int elapsedTime = endSimulation - startTime;
|
||||
float elapsedFloat = (float)elapsedTime / (float)USECS_PER_MSEC;
|
||||
qDebug() << "elapsedTime:" << elapsedTime << "elapsedFloat:" << elapsedFloat;
|
||||
_avatarSimulationTime = elapsedFloat;
|
||||
_fullySimulatedAvatars = fullySimulatedAvatars;
|
||||
_partiallySimulatedAvatars = partiallySimulatedAvatars;
|
||||
qApp->getMain3DScene()->enqueuePendingChanges(pendingChanges);
|
||||
|
||||
simulateAvatarFades(deltaTime);
|
||||
|
|
|
@ -43,6 +43,10 @@ public:
|
|||
std::shared_ptr<MyAvatar> getMyAvatar() { return _myAvatar; }
|
||||
AvatarSharedPointer getAvatarBySessionID(const QUuid& sessionID) override;
|
||||
|
||||
int getFullySimulatedAvatars() { return _fullySimulatedAvatars; }
|
||||
int getPartiallySimulatedAvatars() { return _partiallySimulatedAvatars; }
|
||||
float getAvatarSimulationTime() { return _avatarSimulationTime; }
|
||||
|
||||
void updateMyAvatar(float deltaTime);
|
||||
void updateOtherAvatars(float deltaTime);
|
||||
|
||||
|
@ -112,6 +116,9 @@ private:
|
|||
VectorOfMotionStates _motionStatesToRemoveFromPhysics;
|
||||
|
||||
RateCounter<> _myAvatarSendRate;
|
||||
int _fullySimulatedAvatars { 0 };
|
||||
int _partiallySimulatedAvatars { 0 };
|
||||
float _avatarSimulationTime { 0.0f };
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -121,6 +121,8 @@ void Stats::updateStats(bool force) {
|
|||
auto avatarManager = DependencyManager::get<AvatarManager>();
|
||||
// we need to take one avatar out so we don't include ourselves
|
||||
STAT_UPDATE(avatarCount, avatarManager->size() - 1);
|
||||
STAT_UPDATE(fullySimulatedAvatarCount, avatarManager->getFullySimulatedAvatars());
|
||||
STAT_UPDATE(partiallySimulatedAvatarCount, avatarManager->getPartiallySimulatedAvatars());
|
||||
STAT_UPDATE(serverCount, (int)nodeList->size());
|
||||
STAT_UPDATE(framerate, qApp->getFps());
|
||||
if (qApp->getActiveDisplayPlugin()) {
|
||||
|
@ -306,6 +308,8 @@ void Stats::updateStats(bool force) {
|
|||
// Update Frame timing (in ms)
|
||||
STAT_UPDATE(gpuFrameTime, (float)gpuContext->getFrameTimerGPUAverage());
|
||||
STAT_UPDATE(batchFrameTime, (float)gpuContext->getFrameTimerBatchAverage());
|
||||
STAT_UPDATE(avatarSimulationTime, (float)avatarManager->getAvatarSimulationTime());
|
||||
|
||||
|
||||
STAT_UPDATE(gpuBuffers, (int)gpu::Context::getBufferGPUCount());
|
||||
STAT_UPDATE(gpuBufferMemory, (int)BYTES_TO_MB(gpu::Context::getBufferGPUMemoryUsage()));
|
||||
|
|
|
@ -49,6 +49,8 @@ class Stats : public QQuickItem {
|
|||
STATS_PROPERTY(int, simrate, 0)
|
||||
STATS_PROPERTY(int, avatarSimrate, 0)
|
||||
STATS_PROPERTY(int, avatarCount, 0)
|
||||
STATS_PROPERTY(int, fullySimulatedAvatarCount, 0)
|
||||
STATS_PROPERTY(int, partiallySimulatedAvatarCount, 0)
|
||||
STATS_PROPERTY(int, packetInCount, 0)
|
||||
STATS_PROPERTY(int, packetOutCount, 0)
|
||||
STATS_PROPERTY(float, mbpsIn, 0)
|
||||
|
@ -111,6 +113,7 @@ class Stats : public QQuickItem {
|
|||
STATS_PROPERTY(int, gpuFreeMemory, 0)
|
||||
STATS_PROPERTY(float, gpuFrameTime, 0)
|
||||
STATS_PROPERTY(float, batchFrameTime, 0)
|
||||
STATS_PROPERTY(float, avatarSimulationTime, 0)
|
||||
|
||||
public:
|
||||
static Stats* getInstance();
|
||||
|
@ -156,6 +159,8 @@ signals:
|
|||
void simrateChanged();
|
||||
void avatarSimrateChanged();
|
||||
void avatarCountChanged();
|
||||
void fullySimulatedAvatarCountChanged();
|
||||
void partiallySimulatedAvatarCountChanged();
|
||||
void packetInCountChanged();
|
||||
void packetOutCountChanged();
|
||||
void mbpsInChanged();
|
||||
|
@ -216,6 +221,7 @@ signals:
|
|||
void gpuFreeMemoryChanged();
|
||||
void gpuFrameTimeChanged();
|
||||
void batchFrameTimeChanged();
|
||||
void avatarSimulationTimeChanged();
|
||||
void rectifiedTextureCountChanged();
|
||||
void decimatedTextureCountChanged();
|
||||
|
||||
|
|
|
@ -60,7 +60,8 @@ function updateOverlays() {
|
|||
var overlayPosition = avatar.getJointPosition("Head");
|
||||
overlayPosition.y += 1.05;
|
||||
|
||||
var text = "--- Data from Mixer ---\n"
|
||||
var text = avatarID + "\n"
|
||||
+"--- Data from Mixer ---\n"
|
||||
+"All: " + AvatarManager.getAvatarDataRate(avatarID).toFixed(2) + "kbps (" + AvatarManager.getAvatarUpdateRate(avatarID).toFixed(2) + "hz)" + "\n"
|
||||
+" GP: " + AvatarManager.getAvatarDataRate(avatarID,"globalPosition").toFixed(2) + "kbps (" + AvatarManager.getAvatarUpdateRate(avatarID,"globalPosition").toFixed(2) + "hz)" + "\n"
|
||||
+" LP: " + AvatarManager.getAvatarDataRate(avatarID,"localPosition").toFixed(2) + "kbps (" + AvatarManager.getAvatarUpdateRate(avatarID,"localPosition").toFixed(2) + "hz)" + "\n"
|
||||
|
@ -92,7 +93,7 @@ function updateOverlays() {
|
|||
position: overlayPosition,
|
||||
dimensions: {
|
||||
x: 1.25,
|
||||
y: 18 * 0.13
|
||||
y: 19 * 0.13
|
||||
},
|
||||
lineHeight: 0.1,
|
||||
font:{size:0.1},
|
||||
|
|
Loading…
Reference in a new issue