From 255a2d91ea0ad1992283760a02c9ea0c1177429b Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 20 Aug 2014 20:12:58 -0700 Subject: [PATCH] store: Fixed JSON-serialization of time-series data. Typos caused the end-time and all values to be treated incorrectly. --- src/core/store.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/store.c b/src/core/store.c index c778c52..3bc1114 100644 --- a/src/core/store.c +++ b/src/core/store.c @@ -551,7 +551,7 @@ ts_tojson(sdb_timeseries_t *ts, sdb_strbuf_t *buf) snprintf(start_str, sizeof(start_str), ""); start_str[sizeof(start_str) - 1] = '\0'; if (! sdb_strftime(end_str, sizeof(end_str), - "%F %T %z", ts->start)) + "%F %T %z", ts->end)) snprintf(end_str, sizeof(end_str), ""); end_str[sizeof(end_str) - 1] = '\0'; @@ -571,7 +571,7 @@ ts_tojson(sdb_timeseries_t *ts, sdb_strbuf_t *buf) time_str[sizeof(time_str) - 1] = '\0'; sdb_strbuf_append(buf, "{\"timestamp\": \"%s\", " - "\"value\": \"%s\"}", time_str, ts->data[i][j].value); + "\"value\": \"%f\"}", time_str, ts->data[i][j].value); if (j < ts->data_len - 1) sdb_strbuf_append(buf, ","); -- 2.30.2