summaryrefslogtreecommitdiffstats
path: root/web/api/exporters
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-26 18:05:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-26 18:05:10 +0000
commit34a0b66bc2d48223748ed1cf5bc1b305c396bd74 (patch)
treefbd36be86cc6bc4288fe627f2b5beada569848bb /web/api/exporters
parentAdding upstream version 1.32.1. (diff)
downloadnetdata-34a0b66bc2d48223748ed1cf5bc1b305c396bd74.tar.xz
netdata-34a0b66bc2d48223748ed1cf5bc1b305c396bd74.zip
Adding upstream version 1.33.0.upstream/1.33.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/exporters')
-rw-r--r--web/api/exporters/shell/allmetrics_shell.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/web/api/exporters/shell/allmetrics_shell.c b/web/api/exporters/shell/allmetrics_shell.c
index 0b0ce229..0cbaf306 100644
--- a/web/api/exporters/shell/allmetrics_shell.c
+++ b/web/api/exporters/shell/allmetrics_shell.c
@@ -107,22 +107,23 @@ void rrd_stats_api_v1_charts_allmetrics_json(RRDHOST *host, BUFFER *wb) {
if(rrdset_is_available_for_viewers(st)) {
rrdset_rdlock(st);
- buffer_sprintf(wb, "%s\n"
- "\t\"%s\": {\n"
- "\t\t\"name\":\"%s\",\n"
- "\t\t\"family\":\"%s\",\n"
- "\t\t\"context\":\"%s\",\n"
- "\t\t\"units\":\"%s\",\n"
- "\t\t\"last_updated\": %ld,\n"
- "\t\t\"dimensions\": {"
- , chart_counter?",":""
- , st->id
- , st->name
- , st->family
- , st->context
- , st->units
- , rrdset_last_entry_t_nolock(st)
- );
+ buffer_sprintf(
+ wb,
+ "%s\n"
+ "\t\"%s\": {\n"
+ "\t\t\"name\":\"%s\",\n"
+ "\t\t\"family\":\"%s\",\n"
+ "\t\t\"context\":\"%s\",\n"
+ "\t\t\"units\":\"%s\",\n"
+ "\t\t\"last_updated\": %"PRId64",\n"
+ "\t\t\"dimensions\": {",
+ chart_counter ? "," : "",
+ st->id,
+ st->name,
+ st->family,
+ st->context,
+ st->units,
+ (int64_t)rrdset_last_entry_t_nolock(st));
chart_counter++;
dimension_counter = 0;
@@ -131,15 +132,15 @@ void rrd_stats_api_v1_charts_allmetrics_json(RRDHOST *host, BUFFER *wb) {
RRDDIM *rd;
rrddim_foreach_read(rd, st) {
if(rd->collections_counter && !rrddim_flag_check(rd, RRDDIM_FLAG_OBSOLETE)) {
-
- buffer_sprintf(wb, "%s\n"
- "\t\t\t\"%s\": {\n"
- "\t\t\t\t\"name\": \"%s\",\n"
- "\t\t\t\t\"value\": "
- , dimension_counter?",":""
- , rd->id
- , rd->name
- );
+ buffer_sprintf(
+ wb,
+ "%s\n"
+ "\t\t\t\"%s\": {\n"
+ "\t\t\t\t\"name\": \"%s\",\n"
+ "\t\t\t\t\"value\": ",
+ dimension_counter ? "," : "",
+ rd->id,
+ rd->name);
if(isnan(rd->last_stored_value))
buffer_strcat(wb, "null");