diff options
Diffstat (limited to 'web/api/queries/query.c')
-rw-r--r-- | web/api/queries/query.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/web/api/queries/query.c b/web/api/queries/query.c index 56e2e28500..b45bdf4a45 100644 --- a/web/api/queries/query.c +++ b/web/api/queries/query.c @@ -389,6 +389,7 @@ static inline void do_dimension_variablestep( , long dim_id_in_rrdr , time_t after_wanted , time_t before_wanted + , uint32_t options ){ // RRDSET *st = r->st; @@ -445,7 +446,11 @@ static inline void do_dimension_variablestep( // db_now has a different value than above if (likely(now >= db_now)) { if (likely(does_storage_number_exist(n_curr))) { - value = unpack_storage_number(n_curr); + if (options & RRDR_OPTION_ANOMALY_BIT) + value = (n_curr & SN_ANOMALY_BIT) ? 0.0 : 100.0; + else + value = unpack_storage_number(n_curr); + if (likely(value != 0.0)) values_in_group_non_zero++; @@ -530,6 +535,7 @@ static inline void do_dimension_fixedstep( , long dim_id_in_rrdr , time_t after_wanted , time_t before_wanted + , uint32_t options ){ RRDSET *st = r->st; @@ -593,7 +599,11 @@ static inline void do_dimension_fixedstep( error("INTERNAL CHECK: Unaligned query for %s, database time: %ld, expected time: %ld", rd->id, (long)handle.rrdeng.now, (long)now); } #endif - value = unpack_storage_number(n); + if (options & RRDR_OPTION_ANOMALY_BIT) + value = (n & SN_ANOMALY_BIT) ? 0.0 : 100.0; + else + value = unpack_storage_number(n); + if(likely(value != 0.0)) values_in_group_non_zero++; @@ -1100,6 +1110,7 @@ static RRDR *rrd2rrdr_fixedstep( , c , after_wanted , before_wanted + , options ); if(r->od[c] & RRDR_DIMENSION_NONZERO) @@ -1476,6 +1487,7 @@ static RRDR *rrd2rrdr_variablestep( , c , after_wanted , before_wanted + , options ); if(r->od[c] & RRDR_DIMENSION_NONZERO) @@ -1644,4 +1656,4 @@ RRDR *rrd2rrdr( return rrd2rrdr_fixedstep(st, points_requested, after_requested, before_requested, group_method, resampling_time_requested, options, dimensions, rrd_update_every, first_entry_t, last_entry_t, absolute_period_requested, context_param_list); -}
\ No newline at end of file +} |