]> arthur.barton.de Git - netdata.git/commitdiff
User proper JSON for /api/v1/data
authorSimon Nagl <simonnagl@aim.com>
Sat, 4 Feb 2017 13:04:05 +0000 (14:04 +0100)
committerSimon Nagl <simonnagl@aim.com>
Sat, 4 Feb 2017 13:04:05 +0000 (14:04 +0100)
This fixes issue #83
The output with options=google_json does not change

src/rrd2json.c

index 4bbf61e8db8a87f5bbf4d5cd1bb1e505cbd9c4bd..e079cdd79c5876784617f50b5b4f4699d653fdb0 100644 (file)
@@ -918,14 +918,14 @@ static void rrdr2json(RRDR *r, BUFFER *wb, uint32_t options, int datatable)
     else {
         kq[0] = '"';
         sq[0] = '"';
-        if((options & RRDR_OPTION_SECONDS) || (options & RRDR_OPTION_MILLISECONDS)) {
-            dates = JSON_DATES_TIMESTAMP;
-            dates_with_new = 0;
-        }
-        else {
+        if(options & RRDR_OPTION_GOOGLE_JSON) {
             dates = JSON_DATES_JS;
             dates_with_new = 1;
         }
+        else {
+            dates = JSON_DATES_TIMESTAMP;
+            dates_with_new = 0;
+        }
         if( options & RRDR_OPTION_OBJECTSROWS )
             strcpy(pre_date, "      { ");
         else