Overview
Introduction
Pymetrix can export two types of data:
- Time Series
- Aggregate
in two types of modes:
- Snapshot
- Live Stream
Data Types
1. Time Series
Pymetrix can export time series data with the following format:
{
"message" : {
"id" : "Test",
"nodes" : [
{
"callers" : [
{
"caller" : null,
"time" : "2022-01-09 18:26:51.410001"
}
],
"hits" : 1,
"id" : "Home",
"time" : "2022-01-09 18:26:51.409901"
},
{
"callers" : [
{
"caller" : null,
"time" : "2022-01-09 18:27:02.361461"
}
],
"hits" : 1,
"id" : "Blog",
"time" : "2022-01-09 18:27:02.361310"
},
...
]
},
"response" : 200
}
which can be obtained by:
- calling the
time_series()
method - iterating over the
pipeline(data="time_series", mode="live")
generator method, or calling thepipeline(data="time_series", mode="snapshot")
method and accessing the values of thenode
key
in the metricman
object.
Note that the pipeline()
method is still buggy.
2. Aggregate
Pymetrix can also export the aggregated hits data in the following format:
{
"message" : [
{
"hits" : 1,
"id" : "Home"
},
{
"hits" : 1,
"id" : "Blog"
}
...
],
"response" : 200
}
which can be obtained by:
- calling the
aggregate()
method - iterating over the
pipeline(data="aggregate", mode="live")
generator method, or calling thepipeline(data="aggregate", mode="snapshot")
method
in the metricman
object.
Note that the pipeline()
method is still buggy.
Modes
1. Live
This mode gives the live data of the targets. The live data can be either time series or aggregate.
2. Snapshot
This mode gives the data of the targets UPTO the time when the method is called. As with the live mode, the data can be either time series or aggregate.