dispatch event intergration
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 2m28s
CI / Windows Release Package (push) Successful in 2m24s

This commit is contained in:
Aiden
2026-05-11 15:42:14 +10:00
parent ccfc0237fd
commit a9b08f7f27
16 changed files with 785 additions and 59 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <mutex>
#include <cstddef>
#include <cstdint>
#include <string>
@@ -43,11 +44,37 @@ public:
uint64_t flushedFrameCount = 0;
};
struct RuntimeEventQueueSnapshot
{
std::string queueName = "runtime-events";
std::size_t depth = 0;
std::size_t capacity = 0;
uint64_t droppedCount = 0;
double oldestEventAgeMilliseconds = 0.0;
};
struct RuntimeEventDispatchSnapshot
{
uint64_t dispatchCallCount = 0;
uint64_t dispatchedEventCount = 0;
uint64_t handlerInvocationCount = 0;
uint64_t handlerFailureCount = 0;
double lastDispatchDurationMilliseconds = 0.0;
double maxDispatchDurationMilliseconds = 0.0;
};
struct RuntimeEventMetricsSnapshot
{
RuntimeEventQueueSnapshot queue;
RuntimeEventDispatchSnapshot dispatch;
};
struct Snapshot
{
SignalStatusSnapshot signal;
VideoIOStatusSnapshot videoIO;
PerformanceSnapshot performance;
RuntimeEventMetricsSnapshot runtimeEvents;
};
HealthTelemetry() = default;
@@ -70,9 +97,20 @@ public:
bool TryRecordFramePacingStats(double completionIntervalMilliseconds, double smoothedCompletionIntervalMilliseconds,
double maxCompletionIntervalMilliseconds, uint64_t lateFrameCount, uint64_t droppedFrameCount, uint64_t flushedFrameCount);
void RecordRuntimeEventQueueMetrics(const std::string& queueName, std::size_t depth, std::size_t capacity,
uint64_t droppedCount, double oldestEventAgeMilliseconds);
bool TryRecordRuntimeEventQueueMetrics(const std::string& queueName, std::size_t depth, std::size_t capacity,
uint64_t droppedCount, double oldestEventAgeMilliseconds);
void RecordRuntimeEventDispatchStats(std::size_t dispatchedEvents, std::size_t handlerInvocations,
std::size_t handlerFailures, double dispatchDurationMilliseconds);
bool TryRecordRuntimeEventDispatchStats(std::size_t dispatchedEvents, std::size_t handlerInvocations,
std::size_t handlerFailures, double dispatchDurationMilliseconds);
SignalStatusSnapshot GetSignalStatusSnapshot() const;
VideoIOStatusSnapshot GetVideoIOStatusSnapshot() const;
PerformanceSnapshot GetPerformanceSnapshot() const;
RuntimeEventMetricsSnapshot GetRuntimeEventMetricsSnapshot() const;
Snapshot GetSnapshot() const;
private:
@@ -80,4 +118,5 @@ private:
SignalStatusSnapshot mSignalStatus;
VideoIOStatusSnapshot mVideoIOStatus;
PerformanceSnapshot mPerformance;
RuntimeEventMetricsSnapshot mRuntimeEvents;
};