The stats library aggregates measurements into Views (which are essentially a collection of metrics, each with a different set of labels). All output objects are immutable. The core data types used are:
AggregationData
: contains data from anAggregation
.ViewData
: encapsulatesView
data aggregation.
An AggregationData describes the result of data aggregation. The library SHOULD define an AggregationData for each Aggregation types defined.
The library SHOULD provide support for multiple types of Aggregations:
CountData
: data generated for aCount
aggregation.SumDataDouble
andSumDataInt64
: data generated for aSum
aggregation based on theMeasure
type.LastValueDataDouble
andLastValueDataInt64
: data generated for aLastValue
aggregation based on theMeasure
type.DistributionData
: data generated for aDistribution
aggregation. If there is a histogram in theDistribution
,DistributionData
may contain a list ofExemplar
s.
A ViewData is defined from the following:
View
: the exportedView
.rows
: a map of repeated tag values, and, dependent on Aggregation type in theView
anAggregationData
object. These contain the respective tag values corresponding to thecolumns
parameter from theView
and the aggregated data associated with thosecolumns
.start_time
: a timestamp, describing the start time of the current stats snapshot.end_time
: a timestamp, describing the end time of the current stats snapshot.
The library SHOULD provide a means of retrieving the ViewData for any registered view in the system.
ViewData is a language-specific data structure implementing the Metrics data model.
Aggregation | Measure Type | Metric Type | Value Type | Unit |
---|---|---|---|---|
Count | Int64 or Double | CUMULATIVE | INT64 | Dimensionless Unit |
Sum | Double | CUMULATIVE | DOUBLE | Measure Unit |
Sum | Int64 | CUMULATIVE | INT64 | Measure Unit |
LastValue | Double | GAUGE | DOUBLE | Measure Unit |
LastValue | Int64 | GAUGE | INT64 | Measure Unit |
Distribution | Int64 or Double | CUMULATIVE | DISTRIBUTION | Measure Unit |
Dimensionless Unit can be represented as "1".