Helpers
Health metrics
Helpers for querying device health metrics and summary stats
Health metrics helpers
server_get_health_metrics
- Options:
lookbackSeconds,maxCount; optionaltimestampAnchor(ISO; window end, default now),source,metricName. - Window:
timestamp >= anchor - lookbackSecondsandtimestamp < anchor. Results ordered by timestamp desc, limited bymaxCount. - Returns:
{ status, msg, data: HealthMetric[] }.
server_get_health_metrics_summary
- Options:
device_id, optionallookbackMinutes(default 60). - Returns:
{ status, msg, data }with one row per metric:metric_name,min_value,max_value,avg_value,count.