Inject Custom Time Series Data
API Explorer: /data/timeseries
Restriction: A sequence of two POST requests with the same ts
value within the id_
will append the KPIs of the second POST request to the KPI values written by the previous POST request. This also applies to consecutive posts, where this timestamp value is rounded down to the same value, within secondsPerLabelsDoc.
You can inject your own time-series data into the test results in real time or after the test. Once injected, the data will appear in the Timeline Report in the BlazeMeter UI and be available for retrieval via the API just like any other time-series data in the test results.
The example provided adds new KPIs Lion King|Simba
, Lion King|Mufasa
, The Little Mermaid|Ariel
, and The Little Mermaid|Ursula
to the masterId
of 12345678
under the profileName
of Movies
.
|
character in the metricPath
attribute will create the cascade of sections in the KPI listing in the Timeline Report. For example, Lion King|Simba
will show up as Lion King -> Simba in the listing under the profileName
of Movies
, with the Simba
value being the checkbox selector to load the added time series data (as shown in the following image).
The kpis
array only contains a single data point for each KPI above, but you can add as many of these as necessary to add that data to your Timeline Report (up to 1 second intervals). The same is true for the meterPath
values (as it is in the intervals
array), as you can add as many of these as you need. When using this API, replace the masterId
of 12345678
with your id, the metricPath
values with the ones that describe the KPI data you are passing, and the profileName
of Movies
to your preferred name.
profileName
per master
(or test report), so if you want to add data from several different places (i.e. 2 different services data), use the |
delimiter between the service name and the attribute.Inject Custom Time Series Attributes
Attributes
-
intervals
arrayList of interval metric and KPI details to be loaded to the timeline report
Show/Hide Child Attributes-
_id
objectThe master and metric details for this time series data
Show/Hide Child Attributes-
masterId
integerrequired
The
masterId
you want to inject the KPI date into. Only one master for all the intervals (one master for request) is supported -
metricPath
stringrequired
The path in the profile tree, separated by pipes (
|
), for example:title_1|title_2|title_3
-
ts
integerrequired
The timestamp of the metric (in Epoch Time)
-
-
kpis
arrayThe KPI details for this specific time-series entry
Show/Hide Child Attributes-
value
integerrequired
Value of KPI
-
ts
integerrequired
Timestamp of the KPI (in Epoch Time)
-
-
profileName
stringrequired
Name of the profile to associate the KPI value with
-
Inject Custom Time Series Data
curl 'https://a.blazemeter.com/api/v4/data/timeseries' \
-X POST \
-H 'Content-Type: application/json' \
--user 'api_key_id:api_key_secret' \
-d '{"intervals": [{"_id": {"masterId": 12345678,"metricPath": "Lion King|Simba","ts": 1518429953},"kpis": [{"value": 300,"ts": 1518429953}],"profileName": "Movies"},{"_id": {"masterId": 12345678,"metricPath": "Lion King|Mufasa","ts": 1518429953},"kpis": [{"value": 200,"ts": 1518429953}],"profileName": "Movies"},{"_id": {"masterId": 12345678,"metricPath": "The Little Mermaid|Ariel","ts": 1518429953},"kpis": [{"value": 743,"ts": 1518429953}],"profileName": "Movies"},{"_id": {"masterId": 12345678,"metricPath": "The Little Mermaid|Ursula","ts": 1518429953},"kpis": [{"value": 40,"ts": 1518429953}],"profileName": "Movies"}]}'
Inject Custom Time Series DataInject Custom Time Series Data POST (JSON)
{
"intervals": [
{
"_id": {
"masterId": 12345678,
"metricPath": "Lion King|Simba",
"ts": 1518429953
},
"kpis": [
{
"value": 300,
"ts": 1518429953
}
],
"profileName": "Movies"
},
{
"_id": {
"masterId": 12345678,
"metricPath": "Lion King|Mufasa",
"ts": 1518429953
},
"kpis": [
{
"value": 200,
"ts": 1518429953
}
],
"profileName": "Movies"
},
{
"_id": {
"masterId": 12345678,
"metricPath": "The Little Mermaid|Ariel",
"ts": 1518429953
},
"kpis": [
{
"value": 743,
"ts": 1518429953
}
],
"profileName": "Movies"
},
{
"_id": {
"masterId": 12345678,
"metricPath": "The Little Mermaid|Ursula",
"ts": 1518429953
},
"kpis": [
{
"value": 40,
"ts": 1518429953
}
],
"profileName": "Movies"
}
]
}
Response200 OK
{
"api_version": 4,
"error": null,
"result": [
[
{
"_id": {
"masterId": 12345678,
"metricPath": "Lion King|Simba",
"ts": 1518429953
},
"kpis": [
{
"value": 300,
"ts": 1518429953
}
],
"profileName": "Movies"
},
{
"_id": {
"masterId": 12345678,
"metricPath": "Lion King|Mufasa",
"ts": 1518429953
},
"kpis": [
{
"value": 200,
"ts": 1518429953
}
],
"profileName": "Movies"
},
{
"_id": {
"masterId": 12345678,
"metricPath": "The Little Mermaid|Ariel",
"ts": 1518429953
},
"kpis": [
{
"value": 743,
"ts": 1518429953
}
],
"profileName": "Movies"
},
{
"_id": {
"masterId": 12345678,
"metricPath": "The Little Mermaid|Ursula",
"ts": 1518429953
},
"kpis": [
{
"value": 40,
"ts": 1518429953
}
],
"profileName": "Movies"
}
]
]
}