summaryrefslogtreecommitdiffstats
path: root/web/api/formatters/json/json.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-13 17:15:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-13 17:15:59 +0000
commitff2a76910f4b4da1741e9888f673343099784045 (patch)
tree347a727d55562dd12b4c49bff87322abc28255b9 /web/api/formatters/json/json.c
parentAdding upstream version 1.38.0. (diff)
downloadnetdata-ff2a76910f4b4da1741e9888f673343099784045.tar.xz
netdata-ff2a76910f4b4da1741e9888f673343099784045.zip
Adding upstream version 1.38.1.upstream/1.38.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/formatters/json/json.c')
-rw-r--r--web/api/formatters/json/json.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/web/api/formatters/json/json.c b/web/api/formatters/json/json.c
index 608150cba..3cad3e914 100644
--- a/web/api/formatters/json/json.c
+++ b/web/api/formatters/json/json.c
@@ -111,6 +111,7 @@ void rrdr2json(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, int datatable) {
// print the header lines
for(c = 0, i = 0; c < used ; c++) {
if(unlikely(r->od[c] & RRDR_DIMENSION_HIDDEN)) continue;
+ if(unlikely(!(r->od[c] & RRDR_DIMENSION_QUERIED))) continue;
if(unlikely((options & RRDR_OPTION_NONZERO) && !(r->od[c] & RRDR_DIMENSION_NONZERO))) continue;
buffer_fast_strcat(wb, pre_label, pre_label_len);
@@ -180,7 +181,7 @@ void rrdr2json(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, int datatable) {
// google supports one annotation per row
int annotation_found = 0;
for(c = 0; c < used ; c++) {
- if(unlikely(!(r->od[c] & RRDR_DIMENSION_SELECTED))) continue;
+ if(unlikely(!(r->od[c] & RRDR_DIMENSION_QUERIED))) continue;
if(unlikely(co[c] & RRDR_VALUE_RESET)) {
buffer_fast_strcat(wb, overflow_annotation, overflow_annotation_len);
@@ -215,6 +216,8 @@ void rrdr2json(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, int datatable) {
if(unlikely(options & RRDR_OPTION_PERCENTAGE)) {
total = 0;
for(c = 0; c < used ;c++) {
+ if(unlikely(!(r->od[c] & RRDR_DIMENSION_QUERIED))) continue;
+
NETDATA_DOUBLE n;
if(unlikely(options & RRDR_OPTION_INTERNAL_AR))
n = ar[c];
@@ -234,6 +237,7 @@ void rrdr2json(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, int datatable) {
// for each dimension
for(c = 0; c < used ;c++) {
if(unlikely(r->od[c] & RRDR_DIMENSION_HIDDEN)) continue;
+ if(unlikely(!(r->od[c] & RRDR_DIMENSION_QUERIED))) continue;
if(unlikely((options & RRDR_OPTION_NONZERO) && !(r->od[c] & RRDR_DIMENSION_NONZERO))) continue;
NETDATA_DOUBLE n;