diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-09 04:52:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-09 04:52:57 +0000 |
commit | 00151562145df50cc65e9902d52d5fa77f89fe50 (patch) | |
tree | 2737716802f6725a5074d606ec8fe5422c58a83c /web/api/queries/median | |
parent | Releasing debian version 1.34.1-1. (diff) | |
download | netdata-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/median')
-rw-r--r-- | web/api/queries/median/median.c | 10 | ||||
-rw-r--r-- | web/api/queries/median/median.h | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/web/api/queries/median/median.c b/web/api/queries/median/median.c index 31916c546..bffcee12f 100644 --- a/web/api/queries/median/median.c +++ b/web/api/queries/median/median.c @@ -13,14 +13,14 @@ struct grouping_median { LONG_DOUBLE series[]; }; -void *grouping_create_median(RRDR *r) { +void grouping_create_median(RRDR *r) { long entries = r->group; if(entries < 0) entries = 0; struct grouping_median *g = (struct grouping_median *)callocz(1, sizeof(struct grouping_median) + entries * sizeof(LONG_DOUBLE)); g->series_size = (size_t)entries; - return g; + r->internal.grouping_data = g; } // resets when switches dimensions @@ -41,10 +41,8 @@ void grouping_add_median(RRDR *r, calculated_number value) { if(unlikely(g->next_pos >= g->series_size)) { error("INTERNAL ERROR: median buffer overflow on chart '%s' - next_pos = %zu, series_size = %zu, r->group = %ld.", r->st->name, g->next_pos, g->series_size, r->group); } - else { - if(calculated_number_isnumber(value)) - g->series[g->next_pos++] = (LONG_DOUBLE)value; - } + else + g->series[g->next_pos++] = (LONG_DOUBLE)value; } calculated_number grouping_flush_median(RRDR *r, RRDR_VALUE_FLAGS *rrdr_value_options_ptr) { diff --git a/web/api/queries/median/median.h b/web/api/queries/median/median.h index dd2c1ffc5..28d52b31e 100644 --- a/web/api/queries/median/median.h +++ b/web/api/queries/median/median.h @@ -6,7 +6,7 @@ #include "../query.h" #include "../rrdr.h" -extern void *grouping_create_median(RRDR *r); +extern void grouping_create_median(RRDR *r); extern void grouping_reset_median(RRDR *r); extern void grouping_free_median(RRDR *r); extern void grouping_add_median(RRDR *r, calculated_number value); |