diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-09 04:52:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-09 04:52:39 +0000 |
commit | 89f3604407aff8f4cb2ed958252c61e23c767e24 (patch) | |
tree | 7fbf408102cab051557d38193524d8c6e991d070 /web/api/queries/average | |
parent | Adding upstream version 1.34.1. (diff) | |
download | netdata-89f3604407aff8f4cb2ed958252c61e23c767e24.tar.xz netdata-89f3604407aff8f4cb2ed958252c61e23c767e24.zip |
Adding upstream version 1.35.0.upstream/1.35.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/queries/average')
-rw-r--r-- | web/api/queries/average/average.c | 13 | ||||
-rw-r--r-- | web/api/queries/average/average.h | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/web/api/queries/average/average.c b/web/api/queries/average/average.c index 2c64358e6..2ed33da50 100644 --- a/web/api/queries/average/average.c +++ b/web/api/queries/average/average.c @@ -10,9 +10,8 @@ struct grouping_average { size_t count; }; -void *grouping_create_average(RRDR *r) { - (void)r; - return callocz(1, sizeof(struct grouping_average)); +void grouping_create_average(RRDR *r) { + r->internal.grouping_data = callocz(1, sizeof(struct grouping_average)); } // resets when switches dimensions @@ -29,11 +28,9 @@ void grouping_free_average(RRDR *r) { } void grouping_add_average(RRDR *r, calculated_number value) { - if(!isnan(value)) { - struct grouping_average *g = (struct grouping_average *)r->internal.grouping_data; - g->sum += value; - g->count++; - } + struct grouping_average *g = (struct grouping_average *)r->internal.grouping_data; + g->sum += value; + g->count++; } calculated_number grouping_flush_average(RRDR *r, RRDR_VALUE_FLAGS *rrdr_value_options_ptr) { diff --git a/web/api/queries/average/average.h b/web/api/queries/average/average.h index 9fb7de21a..23ecfac6f 100644 --- a/web/api/queries/average/average.h +++ b/web/api/queries/average/average.h @@ -6,7 +6,7 @@ #include "../query.h" #include "../rrdr.h" -extern void *grouping_create_average(RRDR *r); +extern void grouping_create_average(RRDR *r); extern void grouping_reset_average(RRDR *r); extern void grouping_free_average(RRDR *r); extern void grouping_add_average(RRDR *r, calculated_number value); |