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/incremental_sum | |
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/incremental_sum')
-rw-r--r-- | web/api/queries/incremental_sum/incremental_sum.c | 23 | ||||
-rw-r--r-- | web/api/queries/incremental_sum/incremental_sum.h | 2 |
2 files changed, 11 insertions, 14 deletions
diff --git a/web/api/queries/incremental_sum/incremental_sum.c b/web/api/queries/incremental_sum/incremental_sum.c index 131d85d78..304d9aa74 100644 --- a/web/api/queries/incremental_sum/incremental_sum.c +++ b/web/api/queries/incremental_sum/incremental_sum.c @@ -11,9 +11,8 @@ struct grouping_incremental_sum { size_t count; }; -void *grouping_create_incremental_sum(RRDR *r) { - (void)r; - return callocz(1, sizeof(struct grouping_incremental_sum)); +void grouping_create_incremental_sum(RRDR *r) { + r->internal.grouping_data = callocz(1, sizeof(struct grouping_incremental_sum)); } // resets when switches dimensions @@ -31,17 +30,15 @@ void grouping_free_incremental_sum(RRDR *r) { } void grouping_add_incremental_sum(RRDR *r, calculated_number value) { - if(!isnan(value)) { - struct grouping_incremental_sum *g = (struct grouping_incremental_sum *)r->internal.grouping_data; + struct grouping_incremental_sum *g = (struct grouping_incremental_sum *)r->internal.grouping_data; - if(unlikely(!g->count)) { - g->first = value; - g->count++; - } - else { - g->last = value; - g->count++; - } + if(unlikely(!g->count)) { + g->first = value; + g->count++; + } + else { + g->last = value; + g->count++; } } diff --git a/web/api/queries/incremental_sum/incremental_sum.h b/web/api/queries/incremental_sum/incremental_sum.h index 990a2ac4a..5b55ad3c8 100644 --- a/web/api/queries/incremental_sum/incremental_sum.h +++ b/web/api/queries/incremental_sum/incremental_sum.h @@ -6,7 +6,7 @@ #include "../query.h" #include "../rrdr.h" -extern void *grouping_create_incremental_sum(RRDR *r); +extern void grouping_create_incremental_sum(RRDR *r); extern void grouping_reset_incremental_sum(RRDR *r); extern void grouping_free_incremental_sum(RRDR *r); extern void grouping_add_incremental_sum(RRDR *r, calculated_number value); |