diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-12-01 06:15:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-12-01 06:15:11 +0000 |
commit | 483926a283e118590da3f9ecfa75a8a4d62143ce (patch) | |
tree | cb77052778df9a128a8cd3ff5bf7645322a13bc5 /web/api/queries/query.c | |
parent | Releasing debian version 1.31.0-4. (diff) | |
download | netdata-483926a283e118590da3f9ecfa75a8a4d62143ce.tar.xz netdata-483926a283e118590da3f9ecfa75a8a4d62143ce.zip |
Merging upstream version 1.32.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | web/api/queries/query.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/web/api/queries/query.c b/web/api/queries/query.c index 56e2e2850..216417ae8 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,8 +535,11 @@ static inline void do_dimension_fixedstep( , long dim_id_in_rrdr , time_t after_wanted , time_t before_wanted + , uint32_t options ){ +#ifdef NETDATA_INTERNAL_CHECKS RRDSET *st = r->st; +#endif time_t now = after_wanted, @@ -593,7 +601,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 +1112,7 @@ static RRDR *rrd2rrdr_fixedstep( , c , after_wanted , before_wanted + , options ); if(r->od[c] & RRDR_DIMENSION_NONZERO) @@ -1476,6 +1489,7 @@ static RRDR *rrd2rrdr_variablestep( , c , after_wanted , before_wanted + , options ); if(r->od[c] & RRDR_DIMENSION_NONZERO) @@ -1644,4 +1658,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 +} |