summaryrefslogtreecommitdiffstats
path: root/web/api/formatters/rrdset2json.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-05-21 18:56:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-05-21 18:56:05 +0000
commit54deae27eed83a162ee438ef6bad4a23767757dd (patch)
treeda5333377dfacf22177375aef822a8e696f007eb /web/api/formatters/rrdset2json.c
parentReleasing debian version 1.14.0-1. (diff)
downloadnetdata-54deae27eed83a162ee438ef6bad4a23767757dd.tar.xz
netdata-54deae27eed83a162ee438ef6bad4a23767757dd.zip
Merging upstream version 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
);