Expand description
The metric catalog: one table of key values, one reading per run.
Market metrics are the key values of a market summary. Token and address
metrics are read by watchlists (scope::watch). Each MetricId has one
MetricGroup; describe gives its label, unit and threshold.
summary_metrics defines the market list once. Labels, units, thresholds and
CSV column names all come from it. sample reads one MarketSummary
into values in the same order as the table, and csv_columns gives the
CSV order of the same table.
Every market value is a field the summary computed once for its health checks (spread, top-N depth, health). This module only reads them, so a charted value and the check that judged it cannot differ.
The table has no timestamp or run entry: the CSV writer adds those
two columns in front. This module has no presentation types.
Structs§
- Metric
- One entry of the metric table.
- Missing
Metric - A CSV column the caller needs is missing from the table it passed.
- Sample
- One run’s reading.
values[i]belongs to the metric at indexiof the table passed tosample. A missing value isNone, never zero.
Enums§
- Metric
Group - Where a metric’s value comes from.
- Metric
Id - Identifies one metric of the catalog.
- Threshold
- The limit a metric is judged against.
- Unit
- What a metric’s number measures.
Functions§
- csv_
columns - The table in CSV column order: today’s columns first, then the rest in
table order. The writer adds
timestampandrunbefore these. - csv_
header - The CSV header line for
columns(seecsv_columns), with its newline. - csv_row
- One CSV row, with its newline.
samplereads in the order ofmetrics(the tablesampleused);columnssets the cell order. A flag istrueorfalse; a missing value is-. - describe
- The catalog entry of
id. Market thresholds come fromt; token and address metrics have no default threshold. - sample
- Reads one summary into values, in the order of
metrics. - summary_
metrics - The market metric table, built from the thresholds in force.