public enum AggregateMetric
- Object
- Enum<AggregateMetric>
- AggregateMetric
ImplementsComparable<AggregateMetric>
What to compute over an aggregation bucket. Which metrics are
meaningful depends on the type’s
HealthAggregationStyle; asking for a
nonsensical combination – the total of a body-mass series, say –
fails with HealthError.INVALID_ARGUMENT rather than returning a
number nobody should trust.Enum constants
TOTAL | The sum across the bucket. |
AVERAGE | The mean across the bucket. |
MINIMUM | The smallest value in the bucket. |
MAXIMUM | The largest value in the bucket. |
COUNT | How many samples fell in the bucket. |
DURATION | The total time covered by samples in the bucket, in milliseconds. |
LATEST | The most recent value in the bucket. |
Methods
public static AggregateMetric[] values() | |
public static AggregateMetric valueOf(String name) |
Inherited methods
Enum constant details
TOTAL
TOTALThe sum across the bucket. Meaningful for
HealthAggregationStyle.CUMULATIVE types only.AVERAGE
AVERAGEThe mean across the bucket. Meaningful for
HealthAggregationStyle.DISCRETE types.
Interval samples are weighted by duration and instantaneous samples are weighted equally, so a heart rate held for ten minutes counts for more than a single spot reading.
MINIMUM
MINIMUMThe smallest value in the bucket.
HealthAggregationStyle.DISCRETE
types.MAXIMUM
MAXIMUMThe largest value in the bucket.
HealthAggregationStyle.DISCRETE
types.COUNT
COUNTHow many samples fell in the bucket. Meaningful for every type.
DURATION
DURATIONThe total time covered by samples in the bucket, in milliseconds.
Meaningful for every type; the natural metric for sessions.
LATEST
LATESTThe most recent value in the bucket.
HealthAggregationStyle.DISCRETE types.Method details
values
public static AggregateMetric[] values()valueOf
public static AggregateMetric valueOf(String name)