This commit is contained in:
Aiden
2026-05-11 19:58:14 +10:00
parent 205c90e52e
commit 1629dbc77a
8 changed files with 204 additions and 7 deletions

View File

@@ -69,12 +69,26 @@ public:
RuntimeEventDispatchSnapshot dispatch;
};
struct PersistenceSnapshot
{
uint64_t writeSuccessCount = 0;
uint64_t writeFailureCount = 0;
bool lastWriteSucceeded = true;
bool unsavedChanges = false;
bool newerRequestPending = false;
std::string lastTargetKind;
std::string lastTargetPath;
std::string lastReason;
std::string lastErrorMessage;
};
struct Snapshot
{
SignalStatusSnapshot signal;
VideoIOStatusSnapshot videoIO;
PerformanceSnapshot performance;
RuntimeEventMetricsSnapshot runtimeEvents;
PersistenceSnapshot persistence;
};
HealthTelemetry() = default;
@@ -107,10 +121,16 @@ public:
bool TryRecordRuntimeEventDispatchStats(std::size_t dispatchedEvents, std::size_t handlerInvocations,
std::size_t handlerFailures, double dispatchDurationMilliseconds);
void RecordPersistenceWriteResult(bool succeeded, const std::string& targetKind, const std::string& targetPath,
const std::string& reason, const std::string& errorMessage, bool newerRequestPending);
bool TryRecordPersistenceWriteResult(bool succeeded, const std::string& targetKind, const std::string& targetPath,
const std::string& reason, const std::string& errorMessage, bool newerRequestPending);
SignalStatusSnapshot GetSignalStatusSnapshot() const;
VideoIOStatusSnapshot GetVideoIOStatusSnapshot() const;
PerformanceSnapshot GetPerformanceSnapshot() const;
RuntimeEventMetricsSnapshot GetRuntimeEventMetricsSnapshot() const;
PersistenceSnapshot GetPersistenceSnapshot() const;
Snapshot GetSnapshot() const;
private:
@@ -119,4 +139,5 @@ private:
VideoIOStatusSnapshot mVideoIOStatus;
PerformanceSnapshot mPerformance;
RuntimeEventMetricsSnapshot mRuntimeEvents;
PersistenceSnapshot mPersistence;
};