[FEATURE](components): add dtdhms and additional throughput rate units - #287
[FEATURE](components): add dtdhms and additional throughput rate units#287colivi wants to merge 3 commits into
Conversation
- dtdhms: format duration in seconds as D d HH:MM:SS - throughput: tps, trc/s, trx/s, op/s, msg/s, qps, errors/s, and related rates - count:* units display without the count: prefix Signed-off-by: colivi <charles.olivi@gmail.com>
There was a problem hiding this comment.
The new units have to be supported on backend (CUE) side too, here, otherwise the backend validation will fail. Example of past PR that added units.
Additionally & optionally, if you can map these new units to Grafana ones it would improve the migration quality https://github.com/perses/shared/blob/main/cue/common/migrate/mapping.cue#L18
Backend validation must accept the same unit ids as the TS formatters. Also map Grafana dtdhms and rate aliases in migrate/mapping.cue. Signed-off-by: colivi <charles.olivi@gmail.com>
Thanks Antoine, added backend CUE support in cue/common/format.cue so validation accepts dtdhms and the new throughput unit ids (aligned with the TS formatters). |
Description
Extend value formatters for dashboard panel units:
"dtdhms" ("time.ts")
Throughput rates ("throughput.ts")
New units (id = display suffix):
"tps", "trc/s", "trx/s", "e/s", "op/s", "ops/s", "msg/s", "msg/sec", "errors/s", "calls/s", "qps", "drop/s", "reject/s", "requests/s", "flows/s", "fail/sec", "to/s", "c/s", "gc/s", "tk/s", "cxn/s"
"count:*" variants ("count:tps", "count:traces/s", "count:msg/s") display without the "count:" prefix.
Unit tests added in "time.test.ts" and "throughput.test.ts".
Companion Go SDK PR: "perses/perses" branch "feat/format-units-dtdhms-throughput".
Screenshots
N/A — unit string formatting only (no layout/CSS). Example outputs from tests:
Checklist
UI Changes