Closed jfernandez closed 1 week ago
The failure in CI appears to be unrelated to this change:
23:56:35 [INFO] Histograms:
23:56:35 [INFO] cpu_busy_pct: avg=NaN min=0.00 max=0.00
23:56:35 [INFO] processing_duration_us: avg=NaN min=0.00 max=0.00
23:56:35 [INFO] ---
thread 'main' panicked at src/load_balance.rs:689:25:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I will fix the NaN in the print output though.
This change adds a new module to the scx_utils crate that provides a log recorder for metrics-rs. The log recorder will log all metrics to the console at a configurable interval in an easy to read format. Each metric type will be displayed in a separate section. Indentation will be used to show the hierarchy of the metrics. This results in a more verbose output, but it is easier to read and understand.
scx_rusty was updated to use the log recorder and all explicit metric logging was removed.
Counters will show the total count and the rate of change per second. Counters with an additional label, like
type
indispatched_tasks_total
in rusty, will show the count, rate, and percentage of the total count.Gauges will show the last set value:
Histograms will show the average, min, and max. The histogram will be reset after each log interval to avoid memory leaks, since the data structure that holds the samples is unbounded.
Screencast from 2024-06-23 16-52-37.webm