summaryrefslogtreecommitdiffstats
path: root/web/api/queries/query.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-01 06:15:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-01 06:15:04 +0000
commite970e0b37b8bd7f246feb3f70c4136418225e434 (patch)
tree0b67c0ca45f56f2f9d9c5c2e725279ecdf52d2eb /web/api/queries/query.c
parentAdding upstream version 1.31.0. (diff)
downloadnetdata-e970e0b37b8bd7f246feb3f70c4136418225e434.tar.xz
netdata-e970e0b37b8bd7f246feb3f70c4136418225e434.zip
Adding upstream version 1.32.0.upstream/1.32.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/queries/query.c')
-rw-r--r--web/api/queries/query.c20
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
+}