summaryrefslogtreecommitdiffstats
path: root/web/api/queries/sum
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:57 +0000
commit00151562145df50cc65e9902d52d5fa77f89fe50 (patch)
tree2737716802f6725a5074d606ec8fe5422c58a83c /web/api/queries/sum
parentReleasing debian version 1.34.1-1. (diff)
downloadnetdata-00151562145df50cc65e9902d52d5fa77f89fe50.tar.xz
netdata-00151562145df50cc65e9902d52d5fa77f89fe50.zip
Merging upstream version 1.35.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/queries/sum')
-rw-r--r--web/api/queries/sum/sum.c13
-rw-r--r--web/api/queries/sum/sum.h2
2 files changed, 6 insertions, 9 deletions
diff --git a/web/api/queries/sum/sum.c b/web/api/queries/sum/sum.c
index 0da9937a3..6bb012bb0 100644
--- a/web/api/queries/sum/sum.c
+++ b/web/api/queries/sum/sum.c
@@ -10,9 +10,8 @@ struct grouping_sum {
size_t count;
};
-void *grouping_create_sum(RRDR *r) {
- (void)r;
- return callocz(1, sizeof(struct grouping_sum));
+void grouping_create_sum(RRDR *r) {
+ r->internal.grouping_data = callocz(1, sizeof(struct grouping_sum));
}
// resets when switches dimensions
@@ -29,11 +28,9 @@ void grouping_free_sum(RRDR *r) {
}
void grouping_add_sum(RRDR *r, calculated_number value) {
- if(!isnan(value)) {
- struct grouping_sum *g = (struct grouping_sum *)r->internal.grouping_data;
- g->sum += value;
- g->count++;
- }
+ struct grouping_sum *g = (struct grouping_sum *)r->internal.grouping_data;
+ g->sum += value;
+ g->count++;
}
calculated_number grouping_flush_sum(RRDR *r, RRDR_VALUE_FLAGS *rrdr_value_options_ptr) {
diff --git a/web/api/queries/sum/sum.h b/web/api/queries/sum/sum.h
index 9dc8d209c..05cb6185e 100644
--- a/web/api/queries/sum/sum.h
+++ b/web/api/queries/sum/sum.h
@@ -6,7 +6,7 @@
#include "../query.h"
#include "../rrdr.h"
-extern void *grouping_create_sum(RRDR *r);
+extern void grouping_create_sum(RRDR *r);
extern void grouping_reset_sum(RRDR *r);
extern void grouping_free_sum(RRDR *r);
extern void grouping_add_sum(RRDR *r, calculated_number value);