public enum AggregateMetric

  1. Object
  2. Enum<AggregateMetric>
  3. 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

TOTALThe sum across the bucket.
AVERAGEThe mean across the bucket.
MINIMUMThe smallest value in the bucket.
MAXIMUMThe largest value in the bucket.
COUNTHow many samples fell in the bucket.
DURATIONThe total time covered by samples in the bucket, in milliseconds.
LATESTThe most recent value in the bucket.

Methods

public static AggregateMetric[] values()
public static AggregateMetric valueOf(String name)

Inherited methods

Enum constant details

TOTAL

TOTAL
The sum across the bucket. Meaningful for HealthAggregationStyle.CUMULATIVE types only.

AVERAGE

AVERAGE

The 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

MINIMUM
The smallest value in the bucket. HealthAggregationStyle.DISCRETE types.

MAXIMUM

MAXIMUM
The largest value in the bucket. HealthAggregationStyle.DISCRETE types.

COUNT

COUNT
How many samples fell in the bucket. Meaningful for every type.

DURATION

DURATION
The total time covered by samples in the bucket, in milliseconds. Meaningful for every type; the natural metric for sessions.

LATEST

LATEST
The most recent value in the bucket. HealthAggregationStyle.DISCRETE types.

Method details

values

public static AggregateMetric[] values()

valueOf

public static AggregateMetric valueOf(String name)