summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1fc4fcd)
raw | patch | inline | side by side (parent: 1fc4fcd)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 22 Nov 2014 10:24:53 +0000 (11:24 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 22 Nov 2014 10:24:53 +0000 (11:24 +0100) |
… based on whether a time-series store is configured for the metric.
src/core/store_json.c | patch | blob | history | |
t/unit/core/store_json_test.c | patch | blob | history |
diff --git a/src/core/store_json.c b/src/core/store_json.c
index 8ec717515b69c7e480f0f46c289af689004c4a03..f5be74543f32ed8bbee35b2cff6f95dba828d2e1 100644 (file)
--- a/src/core/store_json.c
+++ b/src/core/store_json.c
else
sdb_strbuf_append(f->buf, "\"value\": %s, ", tmp);
}
+ else if (obj->type == SDB_METRIC) {
+ if (METRIC(obj)->store.type != NULL)
+ sdb_strbuf_append(f->buf, "\"timeseries\": true, ");
+ else
+ sdb_strbuf_append(f->buf, "\"timeseries\": false, ");
+ }
/* TODO: make time and interval formats configurable */
if (! sdb_strftime(time_str, sizeof(time_str),
index d7fad58c8d9793567f476810bd763c5a4516f413..091a48b5519b44663d5493813780fc469fbe5e9d 100644 (file)
"], "
"\"metrics\": ["
"{\"name\": \"m1\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": [], "
"\"attributes\": ["
"\"update_interval\": \"0s\", \"backends\": []}"
"]},"
"{\"name\": \"m2\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": []}"
"]},"
"\"update_interval\": \"0s\", \"backends\": [], "
"\"metrics\": ["
"{\"name\": \"m1\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": []}"
"], "
"], "
"\"metrics\": ["
"{\"name\": \"m2\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": []}"
"]}"
"\"update_interval\": \"0s\", \"backends\": [], "
"\"metrics\": ["
"{\"name\": \"m1\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": [], "
"\"attributes\": ["
"\"update_interval\": \"0s\", \"backends\": []}"
"]},"
"{\"name\": \"m2\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": []}"
"]},"
"\"update_interval\": \"0s\", \"backends\": [], "
"\"metrics\": ["
"{\"name\": \"m1\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": []}"
"]}"
"\"update_interval\": \"0s\", \"backends\": [], "
"\"metrics\": ["
"{\"name\": \"m1\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": []},"
"{\"name\": \"m2\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": []}"
"]},"
"\"update_interval\": \"0s\", \"backends\": [], "
"\"metrics\": ["
"{\"name\": \"m1\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": []}"
"]}"
"\"update_interval\": \"0s\", \"backends\": [], "
"\"metrics\": ["
"{\"name\": \"m2\", "
+ "\"timeseries\": false, "
"\"last_update\": \"1970-01-01 00:00:00 +0000\", "
"\"update_interval\": \"0s\", \"backends\": []}"
"]}"