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/ses | |
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 '')
-rw-r--r-- | web/api/queries/ses/ses.c | 14 | ||||
-rw-r--r-- | web/api/queries/ses/ses.h | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/web/api/queries/ses/ses.c b/web/api/queries/ses/ses.c index 772505f93..ae4a0fa0d 100644 --- a/web/api/queries/ses/ses.c +++ b/web/api/queries/ses/ses.c @@ -48,11 +48,11 @@ static inline void set_alpha(RRDR *r, struct grouping_ses *g) { g->alpha_other = 1.0 - g->alpha; } -void *grouping_create_ses(RRDR *r) { +void grouping_create_ses(RRDR *r) { struct grouping_ses *g = (struct grouping_ses *)callocz(1, sizeof(struct grouping_ses)); set_alpha(r, g); g->level = 0.0; - return g; + r->internal.grouping_data = g; } // resets when switches dimensions @@ -71,13 +71,11 @@ void grouping_free_ses(RRDR *r) { void grouping_add_ses(RRDR *r, calculated_number value) { struct grouping_ses *g = (struct grouping_ses *)r->internal.grouping_data; - if(calculated_number_isnumber(value)) { - if(unlikely(!g->count)) - g->level = value; + if(unlikely(!g->count)) + g->level = value; - g->level = g->alpha * value + g->alpha_other * g->level; - g->count++; - } + g->level = g->alpha * value + g->alpha_other * g->level; + g->count++; } calculated_number grouping_flush_ses(RRDR *r, RRDR_VALUE_FLAGS *rrdr_value_options_ptr) { diff --git a/web/api/queries/ses/ses.h b/web/api/queries/ses/ses.h index 603fdb57c..c05f208f3 100644 --- a/web/api/queries/ses/ses.h +++ b/web/api/queries/ses/ses.h @@ -8,7 +8,7 @@ extern void grouping_init_ses(void); -extern void *grouping_create_ses(RRDR *r); +extern void grouping_create_ses(RRDR *r); extern void grouping_reset_ses(RRDR *r); extern void grouping_free_ses(RRDR *r); extern void grouping_add_ses(RRDR *r, calculated_number value); |