-
Notifications
You must be signed in to change notification settings - Fork 4
Description
One of the most important points of the REST API will be to define how the diagram data that is timebase will be fetched.
We need to take care about the following issues:
- Get data from start-data till end-data
- How is the resolution of the data? Will it be like independent of duration (between start / end) we will always return like 1_000 entries? Or do we have a more dynamic way and not always return the same amount of data? Maybe we have a max amount and will return more than 1_000 points by one single request.
Examples and reads for time series data and requests:
- https://www.sitepoint.com/paginating-real-time-data-cursor-based-pagination/
- https://dvdocs.blob.core.windows.net/docs/endpoints/api.timeseries/endpoints/samples/sample-pagination.html
- https://www.timescale.com/blog/time-series-data/
- https://thenewstack.io/making-it-easier-to-build-apps-with-time-series-data/
- https://learn.microsoft.com/en-us/azure/time-series-insights/time-series-insights-customer-data-requests
Example of a request:
{
"benchmarkId":"123",
"metadata": {
"serverName":"ci-server"
},
"dataSets": ["min", "max", "value"],
"startDate": "2000-10-01T01:30:00.000-05:00",
"endDate": "2000-10-31T01:30:00.000-05:00"
}
In that request we want to receive "min", "max", and "value" data between "startDate" and "endDate" for the benchmark that is defined by "benchmarkId". We only want to receive data that is "tagged" by the given "serverName".
A result than might look like that:
[
{
"benchmarkId":"123",
"dataSet": "min",
"data": [
{
"timestamp":"2000-10-01T01:30:00.000-05:00",
"value": 34.9,
"measuringPointId": "45836"
},{
"timestamp":"2000-10-01T01:31:00.000-05:00",
"value": 35.9,
"measuringPointId": "46843"
},...{
"timestamp":"2000-10-31T01:30:00.000-05:00",
"value": 27.8,
"measuringPointId": "67338"
},
]
},{
"benchmarkId":"123",
"dataSet": "max",
"data": [...]
},{
"benchmarkId":"123",
"dataSet": "value",
"data": [...]
}
]
Here all 3 data arrays (for min/max/value) have exactly the same size and the "timestamp" is the same in all 3 arrays for a given index. (sample: min[134], max[134] and value[134] have different values but all the same timestamp). By doing so it can be rendered in a good way in a diagram. The measuringPointId can be used to get metadata for a specific point (like the git commit id or the Java version.