]> arthur.barton.de Git - netdata.git/commitdiff
dont expose charts that do not have dimensions
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 19 Jul 2016 04:06:35 +0000 (07:06 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 19 Jul 2016 04:06:35 +0000 (07:06 +0300)
src/rrd2json.c

index f0b1f97deff0ce926515b7543faed1f2605f5ecd..0afb4531bc2e2e383603edab0f878c9e29450891 100644 (file)
@@ -98,7 +98,7 @@ void rrd_stats_api_v1_charts(BUFFER *wb)
 
        pthread_rwlock_rdlock(&rrdset_root_rwlock);
        for(st = rrdset_root, c = 0; st ; st = st->next) {
-               if(st->enabled) {
+               if(st->enabled && st->dimensions) {
                        if(c) buffer_strcat(wb, ",");
                        buffer_strcat(wb, "\n\t\t\"");
                        buffer_strcat(wb, st->id);
@@ -239,7 +239,7 @@ void rrd_stats_all_json(BUFFER *wb)
 
        pthread_rwlock_rdlock(&rrdset_root_rwlock);
        for(st = rrdset_root, c = 0; st ; st = st->next) {
-               if(st->enabled) {
+               if(st->enabled && st->dimensions) {
                        if(c) buffer_strcat(wb, ",\n");
                        memory += rrd_stats_one_json(st, NULL, wb);
                        c++;