Module nh_ext_health

The health extension's report.

Description

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}

About mem_used_percent

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.

Those byte counts are also the numbers worth watching on an ESP32. minimum_free_heap_bytes is the one that finds leaks: free heap recovers after a garbage collection, the low-water mark does not.

Function Index

metadata/0Strings that describe the device, and rarely change.
metrics/0Numbers that change, and are worth a graph.
report/0The full report NervesHub stores against the device.
timestamp/0When the report was taken, as RFC 3339.

Function Details

metadata/0

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/0

metrics() -> map()

Numbers that change, and are worth a graph.

report/0

report() -> map()

The full report NervesHub stores against the device.

timestamp/0

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