The health extension's report.
NervesHub asks with health:check and the device answers with
health:report, carrying the shape nerves_hub_link sends:
#{timestamp, metadata, alarms, metrics, checks, connectivity}
NervesHub calculates a device's status from three metrics it knows by name:
cpu_usage_percent, mem_used_percent and disk_used_percentage. None of
them can be answered honestly here.
AtomVM reports free heap, the largest free block and the low-water mark since
boot, but not the heap's total size — so any percentage would be measured
against a number this library made up, and a device would show green or red
on the strength of it. The raw byte counts are reported instead, and a device
shows status unknown until NervesHub is given a metric it recognises.
minimum_free_heap_bytes is the one that finds leaks: free heap recovers
after a garbage collection, the low-water mark does not.
| metadata/0 | Strings that describe the device, and rarely change. |
| metrics/0 | Numbers that change, and are worth a graph. |
| report/0 | The full report NervesHub stores against the device. |
| timestamp/0 | When the report was taken, as RFC 3339. |
metadata() -> map()
Strings that describe the device, and rarely change.
Values are strings: NervesHub stores metadata as a string map, and a number sent here comes back as one anyway.metrics() -> map()
Numbers that change, and are worth a graph.
report() -> map()
The full report NervesHub stores against the device.
timestamp() -> binary() | undefined
When the report was taken, as RFC 3339.
undefined before the clock is set, rather than 1970: a report stamped at
the epoch is worse than one with no stamp, because it looks like data.
Generated by EDoc