input testing
This commit is contained in:
@@ -67,6 +67,12 @@ struct FakeRenderThreadMetrics
|
||||
{
|
||||
uint64_t shaderBuildsCommitted = 0;
|
||||
uint64_t shaderBuildFailures = 0;
|
||||
uint64_t inputFramesReceived = 0;
|
||||
uint64_t inputFramesDropped = 0;
|
||||
double inputLatestAgeMilliseconds = 0.0;
|
||||
double inputUploadMilliseconds = 0.0;
|
||||
bool inputFormatSupported = true;
|
||||
bool inputSignalPresent = false;
|
||||
};
|
||||
|
||||
struct FakeRenderThread
|
||||
@@ -96,6 +102,12 @@ void TestTelemetrySamplesCompletedPollMissesAndShaderCounts()
|
||||
FakeRenderThread renderThread;
|
||||
renderThread.metrics.shaderBuildsCommitted = 1;
|
||||
renderThread.metrics.shaderBuildFailures = 0;
|
||||
renderThread.metrics.inputFramesReceived = 9;
|
||||
renderThread.metrics.inputFramesDropped = 2;
|
||||
renderThread.metrics.inputLatestAgeMilliseconds = 4.5;
|
||||
renderThread.metrics.inputUploadMilliseconds = 0.25;
|
||||
renderThread.metrics.inputFormatSupported = true;
|
||||
renderThread.metrics.inputSignalPresent = true;
|
||||
|
||||
const auto snapshot = telemetry.Sample(exchange, output, outputThread, renderThread);
|
||||
Expect(snapshot.freeFrames == 7, "free frame count is sampled");
|
||||
@@ -104,6 +116,12 @@ void TestTelemetrySamplesCompletedPollMissesAndShaderCounts()
|
||||
Expect(snapshot.completedPollMisses == 12, "completed poll misses are sampled");
|
||||
Expect(snapshot.shaderBuildsCommitted == 1, "shader committed count is sampled");
|
||||
Expect(snapshot.shaderBuildFailures == 0, "shader failure count is sampled");
|
||||
Expect(snapshot.inputFramesReceived == 9, "input received count is sampled");
|
||||
Expect(snapshot.inputFramesDropped == 2, "input dropped count is sampled");
|
||||
Expect(snapshot.inputLatestAgeMilliseconds == 4.5, "input latest age is sampled");
|
||||
Expect(snapshot.inputUploadMilliseconds == 0.25, "input upload timing is sampled");
|
||||
Expect(snapshot.inputFormatSupported, "input format support is sampled");
|
||||
Expect(snapshot.inputSignalPresent, "input signal present is sampled");
|
||||
Expect(snapshot.deckLinkBufferedAvailable, "buffer telemetry availability is sampled");
|
||||
Expect(snapshot.deckLinkBuffered == 4, "buffer depth is sampled");
|
||||
}
|
||||
@@ -148,6 +166,19 @@ void TestTelemetrySerializesToJson()
|
||||
snapshot.dropped = 2;
|
||||
snapshot.shaderBuildsCommitted = 1;
|
||||
snapshot.shaderBuildFailures = 0;
|
||||
snapshot.inputFramesReceived = 10;
|
||||
snapshot.inputFramesDropped = 1;
|
||||
snapshot.inputLatestAgeMilliseconds = 3.5;
|
||||
snapshot.inputUploadMilliseconds = 0.75;
|
||||
snapshot.inputFormatSupported = true;
|
||||
snapshot.inputSignalPresent = true;
|
||||
snapshot.inputCaptureFps = 59.94;
|
||||
snapshot.inputConvertMilliseconds = 4.25;
|
||||
snapshot.inputSubmitMilliseconds = 0.35;
|
||||
snapshot.inputNoSignalFrames = 2;
|
||||
snapshot.inputUnsupportedFrames = 3;
|
||||
snapshot.inputSubmitMisses = 4;
|
||||
snapshot.inputCaptureFormat = "UYVY8";
|
||||
snapshot.deckLinkBufferedAvailable = true;
|
||||
snapshot.deckLinkBuffered = 4;
|
||||
snapshot.deckLinkScheduleCallMilliseconds = 1.25;
|
||||
@@ -160,6 +191,13 @@ void TestTelemetrySerializesToJson()
|
||||
"\"completedPollMisses\":3,\"scheduleFailures\":0,"
|
||||
"\"completions\":117,\"late\":1,\"dropped\":2,"
|
||||
"\"shaderCommitted\":1,\"shaderFailures\":0,"
|
||||
"\"inputFramesReceived\":10,\"inputFramesDropped\":1,"
|
||||
"\"inputLatestAgeMs\":3.5,\"inputUploadMs\":0.75,"
|
||||
"\"inputFormatSupported\":true,\"inputSignalPresent\":true,"
|
||||
"\"inputCaptureFps\":59.94,\"inputConvertMs\":4.25,"
|
||||
"\"inputSubmitMs\":0.35,\"inputNoSignalFrames\":2,"
|
||||
"\"inputUnsupportedFrames\":3,\"inputSubmitMisses\":4,"
|
||||
"\"inputCaptureFormat\":\"UYVY8\","
|
||||
"\"deckLinkBufferedAvailable\":true,\"deckLinkBuffered\":4,"
|
||||
"\"scheduleCallMs\":1.25}";
|
||||
Expect(json == expected, "telemetry snapshot serializes to stable JSON");
|
||||
|
||||
Reference in New Issue
Block a user