diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:45:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:45:55 +0000 |
commit | a8220ab2d293bb7f4b014b79d16b2fb05090fa93 (patch) | |
tree | 77f0a30f016c0925cf7ee9292e644bba183c2774 /web/api/queries/rrdr.c | |
parent | Adding upstream version 1.19.0. (diff) | |
download | netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.tar.xz netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.zip |
Adding upstream version 1.29.0.upstream/1.29.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/queries/rrdr.c')
-rw-r--r-- | web/api/queries/rrdr.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/web/api/queries/rrdr.c b/web/api/queries/rrdr.c index e727e607..6cd0c0b1 100644 --- a/web/api/queries/rrdr.c +++ b/web/api/queries/rrdr.c @@ -98,7 +98,7 @@ inline void rrdr_free(RRDR *r) freez(r); } -RRDR *rrdr_create(RRDSET *st, long n) +RRDR *rrdr_create(struct rrdset *st, long n, struct context_param *context_param_list) { if(unlikely(!st)) { error("NULL value given!"); @@ -110,8 +110,16 @@ RRDR *rrdr_create(RRDSET *st, long n) rrdr_lock_rrdset(r); + RRDDIM *temp_rd = context_param_list ? context_param_list->rd : NULL; RRDDIM *rd; - rrddim_foreach_read(rd, st) r->d++; + if (temp_rd) { + RRDDIM *t = temp_rd; + while (t) { + r->d++; + t = t->next; + } + } else + rrddim_foreach_read(rd, st) r->d++; r->n = n; @@ -122,7 +130,7 @@ RRDR *rrdr_create(RRDSET *st, long n) // set the hidden flag on hidden dimensions int c; - for(c = 0, rd = st->dimensions ; rd ; c++, rd = rd->next) { + for(c = 0, rd = temp_rd?temp_rd:st->dimensions ; rd ; c++, rd = rd->next) { if(unlikely(rrddim_flag_check(rd, RRDDIM_FLAG_HIDDEN))) r->od[c] = RRDR_DIMENSION_HIDDEN; else |