Closed bmr-cymru closed 7 years ago
JSON output is implemented using JSON Time Seried notation.
This is very similar in structure to the proposed dmioscope
JSON format:
{
"docType": "jts",
"version": "1.0",
"header": {
"startTime": "2014-08-16T02:00:00.000Z",
"endTime": "2014-08-16T02:20:43.000Z",
"recordCount": 5,
"columns": {
"0": {
"id": "541a5a129bc9b4035f906d70",
"name": "Temperature",
"dataType": "NUMBER",
"renderType": "VALUE",
"format": "0.###",
"aggregate": "NONE"
}
}
},
"data": [
{
"ts": "2014-08-16T02:00:39.000Z",
"f": { "0": {"v": 28.21, "q": 100 } }
},
{
"ts": "2014-08-16T02:05:40.000Z",
"f": { "0": {"v": 28.22 } }
},
{
"ts": "2014-08-16T02:10:41.000Z",
"f": { "0": {"v": 28.7 } }
},
{
"ts": "2014-08-16T02:15:42.000Z",
"f": { "0": {"v": 29.2, "q": 100 } }
},
{
"ts": "2014-08-16T02:20:43.000Z",
"f": { "0": {"v": 29.18 } }
}
]
}
The dmioscope script should allow logging of histogram data points, in order to do more thorough analysis, or more sophisticated plotting, after a run has finished.
E.g.:
Since someone is bound to want data in JSON format today, we should also support:
This can be achieved by handing an
IOScope
instance a log writer class that accepts an array of data points and writes them into the appropriately formatted output file.In case data is going to a pipe, a
--format
may be required:Suggested data formats for CSV and JSON:
CSV has a header row with N=nr_bins width values, followed by M repetitions of data rows:
E.g.:
Adaptive histograms may need further thought: emitting a new header row, or starting a new JSON object, will correctly set the new width parameters, but may not produce data in a form easily used for plotting.