Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
workbenchthis machine
src/live-metrics.ts: rolling timings with p50/p95, counters and gauges, rendered as Prometheus text - one new module and its test #189
commented
Parked by the crew: the check stayed red through 2 automatic tries (pull #200 closed). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.
Sign in to join this conversation.
Replaces #127, which a builder left without a pull. Pull #131's branch (
smith/127-src-live-metrics-ts-rolling-counters-and) has a version; its check failed only on the old forge.json check block, which main fixed in 1142ee6.Done:
Software/so101/src/live-metrics.tsexportsLiveMetrics:observe(name, ms)(fixed ring buffer, p50/p95),count(name, n)(per-second rate over the last minute),gauge(name, v),snapshot()(plain data),prometheus()(text format) andsummaryLine().[a-z_][a-z0-9_]*(a bad one throws), and label values are escaped.src/live-metrics.test.ts: 10/200 ms timings give the right p50/p95; counters roll off after the window; every non-comment line ofprometheus()matchesname{labels} value.bun test src/live-metrics.test.tsandbun x tsc --noEmitpass.