diff options
Diffstat (limited to 'web/api/queries/ses')
-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); |