Class Aggregation (3.48.0)

public final class Aggregation extends GeneratedMessageV3 implements AggregationOrBuilder

Describes how to combine multiple time series to provide a different view of the data. Aggregation of time series is done in two steps. First, each time series in the set is aligned to the same time interval boundaries, then the set of time series is optionally reduced in number.

Alignment consists of applying the per_series_aligner operation to each time series after its data has been divided into regular alignment_period time intervals. This process takes all of the data points in an alignment period, applies a mathematical transformation such as averaging, minimum, maximum, delta, etc., and converts them into a single data point per period.

Reduction is when the aligned and transformed time series can optionally be combined, reducing the number of time series through similar mathematical transformations. Reduction involves applying a cross_series_reducer to all the time series, optionally sorting the time series into subsets with group_by_fields, and applying the reducer to each subset.

The raw time series data can contain a huge amount of information from multiple sources. Alignment and reduction transforms this mass of data into a more manageable and representative collection of data, for example "the 95% latency across the average of all tasks in a cluster". This representative data can be more easily graphed and comprehended, and the individual time series data is still available for later drilldown. For more details, see Filtering and aggregation.

Protobuf type google.monitoring.v3.Aggregation

Static Fields

ALIGNMENT_PERIOD_FIELD_NUMBER

public static final int ALIGNMENT_PERIOD_FIELD_NUMBER
Field Value
Type Description
int

CROSS_SERIES_REDUCER_FIELD_NUMBER

public static final int CROSS_SERIES_REDUCER_FIELD_NUMBER
Field Value
Type Description
int

GROUP_BY_FIELDS_FIELD_NUMBER

public static final int GROUP_BY_FIELDS_FIELD_NUMBER
Field Value
Type Description
int

PER_SERIES_ALIGNER_FIELD_NUMBER

public static final int PER_SERIES_ALIGNER_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Aggregation getDefaultInstance()
Returns
Type Description
Aggregation

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Aggregation.Builder newBuilder()
Returns
Type Description
Aggregation.Builder

newBuilder(Aggregation prototype)

public static Aggregation.Builder newBuilder(Aggregation prototype)
Parameter
Name Description
prototype Aggregation
Returns
Type Description
Aggregation.Builder

parseDelimitedFrom(InputStream input)

public static Aggregation parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Aggregation
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Aggregation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Aggregation
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Aggregation parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Aggregation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Aggregation parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Aggregation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Aggregation parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Aggregation
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Aggregation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Aggregation
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Aggregation parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Aggregation
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Aggregation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Aggregation
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Aggregation parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Aggregation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Aggregation> parser()
Returns
Type Description
Parser<Aggregation>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAlignmentPeriod()

public Duration getAlignmentPeriod()

The alignment_period specifies a time interval, in seconds, that is used to divide the data in all the time series into consistent blocks of time. This will be done before the per-series aligner can be applied to the data.

The value must be at least 60 seconds. If a per-series aligner other than ALIGN_NONE is specified, this field is required or an error is returned. If no per-series aligner is specified, or the aligner ALIGN_NONE is specified, then this field is ignored.

The maximum value of the alignment_period is 104 weeks (2 years) for charts, and 90,000 seconds (25 hours) for alerting policies.

.google.protobuf.Duration alignment_period = 1;

Returns
Type Description
Duration

The alignmentPeriod.

getAlignmentPeriodOrBuilder()

public DurationOrBuilder getAlignmentPeriodOrBuilder()

The alignment_period specifies a time interval, in seconds, that is used to divide the data in all the time series into consistent blocks of time. This will be done before the per-series aligner can be applied to the data.

The value must be at least 60 seconds. If a per-series aligner other than ALIGN_NONE is specified, this field is required or an error is returned. If no per-series aligner is specified, or the aligner ALIGN_NONE is specified, then this field is ignored.

The maximum value of the alignment_period is 104 weeks (2 years) for charts, and 90,000 seconds (25 hours) for alerting policies.

.google.protobuf.Duration alignment_period = 1;

Returns
Type Description
DurationOrBuilder

getCrossSeriesReducer()

public Aggregation.Reducer getCrossSeriesReducer()

The reduction operation to be used to combine time series into a single time series, where the value of each data point in the resulting series is a function of all the already aligned values in the input time series.

Not all reducer operations can be applied to all time series. The valid choices depend on the metric_kind and the value_type of the original time series. Reduction can yield a time series with a different metric_kind or value_type than the input time series.

Time series data must first be aligned (see per_series_aligner) in order to perform cross-time series reduction. If cross_series_reducer is specified, then per_series_aligner must be specified, and must not be ALIGN_NONE. An alignment_period must also be specified; otherwise, an error is returned.

.google.monitoring.v3.Aggregation.Reducer cross_series_reducer = 4;

Returns
Type Description
Aggregation.Reducer

The crossSeriesReducer.

getCrossSeriesReducerValue()

public int getCrossSeriesReducerValue()

The reduction operation to be used to combine time series into a single time series, where the value of each data point in the resulting series is a function of all the already aligned values in the input time series.

Not all reducer operations can be applied to all time series. The valid choices depend on the metric_kind and the value_type of the original time series. Reduction can yield a time series with a different metric_kind or value_type than the input time series.

Time series data must first be aligned (see per_series_aligner) in order to perform cross-time series reduction. If cross_series_reducer is specified, then per_series_aligner must be specified, and must not be ALIGN_NONE. An alignment_period must also be specified; otherwise, an error is returned.

.google.monitoring.v3.Aggregation.Reducer cross_series_reducer = 4;

Returns
Type Description
int

The enum numeric value on the wire for crossSeriesReducer.

getDefaultInstanceForType()

public Aggregation getDefaultInstanceForType()
Returns
Type Description
Aggregation

getGroupByFields(int index)

public String getGroupByFields(int index)

The set of fields to preserve when cross_series_reducer is specified. The group_by_fields determine how the time series are partitioned into subsets prior to applying the aggregation operation. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The cross_series_reducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in group_by_fields are aggregated away. If group_by_fields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If cross_series_reducer is not defined, this field is ignored.

repeated string group_by_fields = 5;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The groupByFields at the given index.

getGroupByFieldsBytes(int index)

public ByteString getGroupByFieldsBytes(int index)

The set of fields to preserve when cross_series_reducer is specified. The group_by_fields determine how the time series are partitioned into subsets prior to applying the aggregation operation. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The cross_series_reducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in group_by_fields are aggregated away. If group_by_fields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If cross_series_reducer is not defined, this field is ignored.

repeated string group_by_fields = 5;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the groupByFields at the given index.

getGroupByFieldsCount()

public int getGroupByFieldsCount()

The set of fields to preserve when cross_series_reducer is specified. The group_by_fields determine how the time series are partitioned into subsets prior to applying the aggregation operation. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The cross_series_reducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in group_by_fields are aggregated away. If group_by_fields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If cross_series_reducer is not defined, this field is ignored.

repeated string group_by_fields = 5;

Returns
Type Description
int

The count of groupByFields.

getGroupByFieldsList()

public ProtocolStringList getGroupByFieldsList()

The set of fields to preserve when cross_series_reducer is specified. The group_by_fields determine how the time series are partitioned into subsets prior to applying the aggregation operation. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The cross_series_reducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in group_by_fields are aggregated away. If group_by_fields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If cross_series_reducer is not defined, this field is ignored.

repeated string group_by_fields = 5;

Returns
Type Description
ProtocolStringList

A list containing the groupByFields.

getParserForType()

public Parser<Aggregation> getParserForType()
Returns
Type Description
Parser<Aggregation>
Overrides

getPerSeriesAligner()

public Aggregation.Aligner getPerSeriesAligner()

An Aligner describes how to bring the data points in a single time series into temporal alignment. Except for ALIGN_NONE, all alignments cause all the data points in an alignment_period to be mathematically grouped together, resulting in a single data point for each alignment_period with end timestamp at the end of the period.

Not all alignment operations may be applied to all time series. The valid choices depend on the metric_kind and value_type of the original time series. Alignment can change the metric_kind or the value_type of the time series.

Time series data must be aligned in order to perform cross-time series reduction. If cross_series_reducer is specified, then per_series_aligner must be specified and not equal to ALIGN_NONE and alignment_period must be specified; otherwise, an error is returned.

.google.monitoring.v3.Aggregation.Aligner per_series_aligner = 2;

Returns
Type Description
Aggregation.Aligner

The perSeriesAligner.

getPerSeriesAlignerValue()

public int getPerSeriesAlignerValue()

An Aligner describes how to bring the data points in a single time series into temporal alignment. Except for ALIGN_NONE, all alignments cause all the data points in an alignment_period to be mathematically grouped together, resulting in a single data point for each alignment_period with end timestamp at the end of the period.

Not all alignment operations may be applied to all time series. The valid choices depend on the metric_kind and value_type of the original time series. Alignment can change the metric_kind or the value_type of the time series.

Time series data must be aligned in order to perform cross-time series reduction. If cross_series_reducer is specified, then per_series_aligner must be specified and not equal to ALIGN_NONE and alignment_period must be specified; otherwise, an error is returned.

.google.monitoring.v3.Aggregation.Aligner per_series_aligner = 2;

Returns
Type Description
int

The enum numeric value on the wire for perSeriesAligner.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasAlignmentPeriod()

public boolean hasAlignmentPeriod()

The alignment_period specifies a time interval, in seconds, that is used to divide the data in all the time series into consistent blocks of time. This will be done before the per-series aligner can be applied to the data.

The value must be at least 60 seconds. If a per-series aligner other than ALIGN_NONE is specified, this field is required or an error is returned. If no per-series aligner is specified, or the aligner ALIGN_NONE is specified, then this field is ignored.

The maximum value of the alignment_period is 104 weeks (2 years) for charts, and 90,000 seconds (25 hours) for alerting policies.

.google.protobuf.Duration alignment_period = 1;

Returns
Type Description
boolean

Whether the alignmentPeriod field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Aggregation.Builder newBuilderForType()
Returns
Type Description
Aggregation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Aggregation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Aggregation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Aggregation.Builder toBuilder()
Returns
Type Description
Aggregation.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException