Improvement
This commit is contained in:
@@ -91,6 +91,16 @@ JsonValue RuntimeStatePresenter::BuildRuntimeStateValue(const RuntimeStore& runt
|
||||
readyQueue.set("droppedCount", JsonValue(static_cast<double>(telemetrySnapshot.backendPlayout.readyQueueDroppedCount)));
|
||||
readyQueue.set("underrunCount", JsonValue(static_cast<double>(telemetrySnapshot.backendPlayout.readyQueueUnderrunCount)));
|
||||
|
||||
JsonValue systemMemory = JsonValue::MakeObject();
|
||||
systemMemory.set("freeFrameCount", JsonValue(static_cast<double>(telemetrySnapshot.backendPlayout.systemFramePoolFree)));
|
||||
systemMemory.set("readyFrameCount", JsonValue(static_cast<double>(telemetrySnapshot.backendPlayout.systemFramePoolReady)));
|
||||
systemMemory.set("scheduledFrameCount", JsonValue(static_cast<double>(telemetrySnapshot.backendPlayout.systemFramePoolScheduled)));
|
||||
systemMemory.set("underrunCount", JsonValue(static_cast<double>(telemetrySnapshot.backendPlayout.systemFrameUnderrunCount)));
|
||||
systemMemory.set("repeatCount", JsonValue(static_cast<double>(telemetrySnapshot.backendPlayout.systemFrameRepeatCount)));
|
||||
systemMemory.set("dropCount", JsonValue(static_cast<double>(telemetrySnapshot.backendPlayout.systemFrameDropCount)));
|
||||
systemMemory.set("ageAtScheduleMs", JsonValue(telemetrySnapshot.backendPlayout.systemFrameAgeAtScheduleMilliseconds));
|
||||
systemMemory.set("ageAtCompletionMs", JsonValue(telemetrySnapshot.backendPlayout.systemFrameAgeAtCompletionMilliseconds));
|
||||
|
||||
JsonValue outputRender = JsonValue::MakeObject();
|
||||
outputRender.set("renderMs", JsonValue(telemetrySnapshot.backendPlayout.outputRenderMilliseconds));
|
||||
outputRender.set("smoothedRenderMs", JsonValue(telemetrySnapshot.backendPlayout.smoothedOutputRenderMilliseconds));
|
||||
@@ -132,6 +142,7 @@ JsonValue RuntimeStatePresenter::BuildRuntimeStateValue(const RuntimeStore& runt
|
||||
backendPlayout.set("droppedFrameCount", JsonValue(static_cast<double>(telemetrySnapshot.backendPlayout.droppedFrameCount)));
|
||||
backendPlayout.set("flushedFrameCount", JsonValue(static_cast<double>(telemetrySnapshot.backendPlayout.flushedFrameCount)));
|
||||
backendPlayout.set("readyQueue", readyQueue);
|
||||
backendPlayout.set("systemMemory", systemMemory);
|
||||
backendPlayout.set("outputRender", outputRender);
|
||||
backendPlayout.set("recovery", recovery);
|
||||
root.set("backendPlayout", backendPlayout);
|
||||
|
||||
@@ -313,6 +313,40 @@ bool HealthTelemetry::TryRecordOutputRenderQueueWait(double queueWaitMillisecond
|
||||
return true;
|
||||
}
|
||||
|
||||
void HealthTelemetry::RecordSystemMemoryPlayoutStats(std::size_t freeFrameCount, std::size_t readyFrameCount,
|
||||
std::size_t scheduledFrameCount, uint64_t underrunCount, uint64_t repeatCount, uint64_t dropCount,
|
||||
double frameAgeAtScheduleMilliseconds, double frameAgeAtCompletionMilliseconds)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
mBackendPlayout.systemFramePoolFree = freeFrameCount;
|
||||
mBackendPlayout.systemFramePoolReady = readyFrameCount;
|
||||
mBackendPlayout.systemFramePoolScheduled = scheduledFrameCount;
|
||||
mBackendPlayout.systemFrameUnderrunCount = underrunCount;
|
||||
mBackendPlayout.systemFrameRepeatCount = repeatCount;
|
||||
mBackendPlayout.systemFrameDropCount = dropCount;
|
||||
mBackendPlayout.systemFrameAgeAtScheduleMilliseconds = std::max(frameAgeAtScheduleMilliseconds, 0.0);
|
||||
mBackendPlayout.systemFrameAgeAtCompletionMilliseconds = std::max(frameAgeAtCompletionMilliseconds, 0.0);
|
||||
}
|
||||
|
||||
bool HealthTelemetry::TryRecordSystemMemoryPlayoutStats(std::size_t freeFrameCount, std::size_t readyFrameCount,
|
||||
std::size_t scheduledFrameCount, uint64_t underrunCount, uint64_t repeatCount, uint64_t dropCount,
|
||||
double frameAgeAtScheduleMilliseconds, double frameAgeAtCompletionMilliseconds)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mMutex, std::try_to_lock);
|
||||
if (!lock.owns_lock())
|
||||
return false;
|
||||
|
||||
mBackendPlayout.systemFramePoolFree = freeFrameCount;
|
||||
mBackendPlayout.systemFramePoolReady = readyFrameCount;
|
||||
mBackendPlayout.systemFramePoolScheduled = scheduledFrameCount;
|
||||
mBackendPlayout.systemFrameUnderrunCount = underrunCount;
|
||||
mBackendPlayout.systemFrameRepeatCount = repeatCount;
|
||||
mBackendPlayout.systemFrameDropCount = dropCount;
|
||||
mBackendPlayout.systemFrameAgeAtScheduleMilliseconds = std::max(frameAgeAtScheduleMilliseconds, 0.0);
|
||||
mBackendPlayout.systemFrameAgeAtCompletionMilliseconds = std::max(frameAgeAtCompletionMilliseconds, 0.0);
|
||||
return true;
|
||||
}
|
||||
|
||||
void HealthTelemetry::RecordOutputRenderPipelineTiming(
|
||||
double drawMilliseconds,
|
||||
double fenceWaitMilliseconds,
|
||||
|
||||
@@ -94,6 +94,14 @@ public:
|
||||
uint64_t readyQueuePoppedCount = 0;
|
||||
uint64_t readyQueueDroppedCount = 0;
|
||||
uint64_t readyQueueUnderrunCount = 0;
|
||||
std::size_t systemFramePoolFree = 0;
|
||||
std::size_t systemFramePoolReady = 0;
|
||||
std::size_t systemFramePoolScheduled = 0;
|
||||
uint64_t systemFrameUnderrunCount = 0;
|
||||
uint64_t systemFrameRepeatCount = 0;
|
||||
uint64_t systemFrameDropCount = 0;
|
||||
double systemFrameAgeAtScheduleMilliseconds = 0.0;
|
||||
double systemFrameAgeAtCompletionMilliseconds = 0.0;
|
||||
double outputRenderMilliseconds = 0.0;
|
||||
double smoothedOutputRenderMilliseconds = 0.0;
|
||||
double maxOutputRenderMilliseconds = 0.0;
|
||||
@@ -198,6 +206,13 @@ public:
|
||||
void RecordOutputRenderQueueWait(double queueWaitMilliseconds);
|
||||
bool TryRecordOutputRenderQueueWait(double queueWaitMilliseconds);
|
||||
|
||||
void RecordSystemMemoryPlayoutStats(std::size_t freeFrameCount, std::size_t readyFrameCount,
|
||||
std::size_t scheduledFrameCount, uint64_t underrunCount, uint64_t repeatCount, uint64_t dropCount,
|
||||
double frameAgeAtScheduleMilliseconds, double frameAgeAtCompletionMilliseconds);
|
||||
bool TryRecordSystemMemoryPlayoutStats(std::size_t freeFrameCount, std::size_t readyFrameCount,
|
||||
std::size_t scheduledFrameCount, uint64_t underrunCount, uint64_t repeatCount, uint64_t dropCount,
|
||||
double frameAgeAtScheduleMilliseconds, double frameAgeAtCompletionMilliseconds);
|
||||
|
||||
void RecordOutputRenderPipelineTiming(
|
||||
double drawMilliseconds,
|
||||
double fenceWaitMilliseconds,
|
||||
|
||||
Reference in New Issue
Block a user