summaryrefslogtreecommitdiffstats
path: root/libnetdata
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2023-03-28 15:23:03 +0300
committerGitHub <noreply@github.com>2023-03-28 15:23:03 +0300
commit8a036f0b244a15252a009524fef4702e7e000c50 (patch)
tree99661068f14617b0cb0d0e626d88360f2e07d7fa /libnetdata
parentd40aad303e2ca73648b3bdb9e2590157b8fd5cf1 (diff)
/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
Diffstat (limited to 'libnetdata')
-rw-r--r--libnetdata/libnetdata.h7
1 files changed, 5 insertions, 2 deletions
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);