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/max | |
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/max')
-rw-r--r-- | web/api/queries/max/max.c | 15 | ||||
-rw-r--r-- | web/api/queries/max/max.h | 2 |
2 files changed, 7 insertions, 10 deletions
diff --git a/web/api/queries/max/max.c b/web/api/queries/max/max.c index a4be36ad..b6e72331 100644 --- a/web/api/queries/max/max.c +++ b/web/api/queries/max/max.c @@ -10,9 +10,8 @@ struct grouping_max { size_t count; }; -void *grouping_create_max(RRDR *r) { - (void)r; - return callocz(1, sizeof(struct grouping_max)); +void grouping_create_max(RRDR *r) { + r->internal.grouping_data = callocz(1, sizeof(struct grouping_max)); } // resets when switches dimensions @@ -29,13 +28,11 @@ void grouping_free_max(RRDR *r) { } void grouping_add_max(RRDR *r, calculated_number value) { - if(!isnan(value)) { - struct grouping_max *g = (struct grouping_max *)r->internal.grouping_data; + struct grouping_max *g = (struct grouping_max *)r->internal.grouping_data; - if(!g->count || calculated_number_fabs(value) > calculated_number_fabs(g->max)) { - g->max = value; - g->count++; - } + if(!g->count || calculated_number_fabs(value) > calculated_number_fabs(g->max)) { + g->max = value; + g->count++; } } diff --git a/web/api/queries/max/max.h b/web/api/queries/max/max.h index d839fe3f..7b606ce3 100644 --- a/web/api/queries/max/max.h +++ b/web/api/queries/max/max.h @@ -6,7 +6,7 @@ #include "../query.h" #include "../rrdr.h" -extern void *grouping_create_max(RRDR *r); +extern void grouping_create_max(RRDR *r); extern void grouping_reset_max(RRDR *r); extern void grouping_free_max(RRDR *r); extern void grouping_add_max(RRDR *r, calculated_number value); |