MCPcopy Create free account
hub / github.com/SethGammon/Citadel / readTelemetryFileStats

Function readTelemetryFileStats

scripts/telemetry-stats.js:95–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93// ── Telemetry file stats ──────────────────────────────────────────────────────
94
95function readTelemetryFileStats() {
96 const agentRuns = readJsonl(path.join(TELEMETRY_DIR, 'agent-runs.jsonl'));
97 const hookTiming = readJsonl(path.join(TELEMETRY_DIR, 'hook-timing.jsonl'));
98 const today = todayPrefix();
99
100 const last_event = agentRuns.length > 0
101 ? agentRuns[agentRuns.length - 1].timestamp
102 : null;
103
104 const hook_fires_today = hookTiming.filter(
105 e => typeof e.timestamp === 'string' && e.timestamp.startsWith(today)
106 ).length;
107
108 return {
109 last_event,
110 event_count: agentRuns.length,
111 hook_fires_today,
112 };
113}
114
115// ── Coordination stats ────────────────────────────────────────────────────────
116

Callers 1

mainFunction · 0.85

Calls 2

todayPrefixFunction · 0.85
readJsonlFunction · 0.70

Tested by

no test coverage detected