From 8a036f0b244a15252a009524fef4702e7e000c50 Mon Sep 17 00:00:00 2001 From: Costa Tsaousis Date: Tue, 28 Mar 2023 15:23:03 +0300 Subject: /api/v2/X part 7 (#14797) * /api/v2/weights, points key renamed to result * /api/v2/weights, add node ids in response * /api/v2/data remove NONZERO flag when all dimensions are zero and fix MIN/MAX grouping and statistics * /api/v2/data expose view.dimensions.sts{} * /api/v2 endpoints expose agents and additional info per node, that is needed to unify cloud responses * /api/v2 nodes output now includes the duration of time spent per node * jsonwrap view object renames and cleanup * rework of the statistics returned by the query engine * swagger work * swagger work * more swagger work * updated swagger json * added the remaining of the /api/v2 endpoints to swagger * point.ar has been renamed point.arp * updated weights endpoint * fix compilation warnings --- libnetdata/libnetdata.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libnetdata') diff --git a/libnetdata/libnetdata.h b/libnetdata/libnetdata.h index 31902b3966..1a2d7c5b96 100644 --- a/libnetdata/libnetdata.h +++ b/libnetdata/libnetdata.h @@ -377,8 +377,8 @@ typedef struct storage_point { time_t start_time_s; // the time the point starts time_t end_time_s; // the time the point ends - size_t count; // the number of original points aggregated - size_t anomaly_count; // the number of original points found anomalous + uint32_t count; // the number of original points aggregated + uint32_t anomaly_count; // the number of original points found anomalous SN_FLAGS flags; // flags stored with the point } STORAGE_POINT; @@ -482,6 +482,9 @@ typedef struct storage_point { #define storage_point_anomaly_rate(sp) \ (NETDATA_DOUBLE)(storage_point_is_unset(sp) ? 0.0 : (NETDATA_DOUBLE)((sp).anomaly_count) * 100.0 / (NETDATA_DOUBLE)((sp).count)) +#define storage_point_average_value(sp) \ + ((sp).count ? (sp).sum / (NETDATA_DOUBLE)((sp).count) : 0.0) + // --------------------------------------------------------------------------------------------- void netdata_fix_chart_id(char *s); -- cgit v1.2.3