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

Function formatCompressionReport

core/telemetry/report.js:180–205  ·  view source on GitHub ↗
(report)

Source from the content-addressed store, hash-verified

178}
179
180function formatCompressionReport(report) {
181 if (report.totalEntries === 0) return 'No compression stats recorded yet.\n';
182
183 const lines = [
184 '',
185 '=== Discovery Compression Stats ===',
186 '',
187 ` Compressions: ${report.totalEntries}`,
188 ` Total input: ${report.totalInput} chars`,
189 ` Total output: ${report.totalOutput} chars`,
190 ` Average ratio: ${(report.averageRatio * 100).toFixed(1)}%`,
191 '',
192 '--- Recent ---',
193 '',
194 ];
195
196 for (const entry of report.recent) {
197 lines.push(` ${entry.agent}: ${entry.inputChars} → ${entry.outputChars} chars (${(entry.ratio * 100).toFixed(1)}%)`);
198 }
199
200 if (report.invalidSummary) {
201 lines.push('', `Invalid lines: ${report.invalidSummary}`);
202 }
203
204 return lines.join('\n') + '\n';
205}
206
207module.exports = {
208 buildAgentReport,

Callers 2

compressionReportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected