summaryrefslogtreecommitdiffstats
path: root/web/api/formatters/rrdset2json.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-05-21 18:55:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-05-21 18:55:22 +0000
commit61d0027904ee9c040985b1642ca228737d616d03 (patch)
treec90838c137b4dc4a2de1cff9f2d7be5552d605e7 /web/api/formatters/rrdset2json.c
parentAdding upstream version 1.14.0. (diff)
downloadnetdata-61d0027904ee9c040985b1642ca228737d616d03.tar.xz
netdata-61d0027904ee9c040985b1642ca228737d616d03.zip
Adding upstream version 1.15.0.upstream/1.15.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/formatters/rrdset2json.c')
-rw-r--r--web/api/formatters/rrdset2json.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/web/api/formatters/rrdset2json.c b/web/api/formatters/rrdset2json.c
index b1971e2a0..2bbd2a70f 100644
--- a/web/api/formatters/rrdset2json.c
+++ b/web/api/formatters/rrdset2json.c
@@ -7,6 +7,9 @@
void rrdset2json(RRDSET *st, BUFFER *wb, size_t *dimensions_count, size_t *memory_used) {
rrdset_rdlock(st);
+ time_t first_entry_t = rrdset_first_entry_t(st);
+ time_t last_entry_t = rrdset_last_entry_t(st);
+
buffer_sprintf(wb,
"\t\t{\n"
"\t\t\t\"id\": \"%s\",\n"
@@ -40,9 +43,9 @@ void rrdset2json(RRDSET *st, BUFFER *wb, size_t *dimensions_count, size_t *memor
, st->units
, st->name
, rrdset_type_name(st->chart_type)
- , st->entries * st->update_every
- , rrdset_first_entry_t(st)
- , rrdset_last_entry_t(st)
+ , last_entry_t - first_entry_t + st->update_every//st->entries * st->update_every
+ , first_entry_t//rrdset_first_entry_t(st)
+ , last_entry_t//rrdset_last_entry_t(st)
, st->update_every
);