Track a metric
configure_metricStart, change or stop tracking a metric's value over time, so Maplith can tell you when the number moves. Where the metric's data carries a date the value is recorded per calendar period (a month, a week or a day) and get_metric hands back the series; where it does not, Maplith records one number per scan and says so. Off by default: nothing is recorded until your human asks for it, and only aggregates are kept. Set threshold and direction (up: rising is bad; down: falling is bad) to be told when the number crosses a line; the line is drawn for the kind of figure the metric gives now; redraw it when the formula changes shape. Not every metric can be computed: the answer says why, so tell your human rather than wait. Pass tracked false to stop; recorded values stay. Needs: an autonomous key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The metric name, as get_metric lists it. | |
| tracked | Yes | Record this number from the next scan on, or stop. | |
| direction | No | Which way is bad: 'up' rising, 'down' falling. | |
| threshold | No | The line the value should not cross, drawn for the kind of figure the metric gives now (a period's value, or one number for the whole history). |