Statistic

class aws_cdk.aws_cloudwatch.Statistic(value)

Bases: Enum

Statistic to use over the aggregation period.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_cloudwatch as cloudwatch
# delivery_stream: firehose.DeliveryStream


# Alarm that triggers when the per-second average of incoming bytes exceeds 90% of the current service limit
incoming_bytes_percent_of_limit = cloudwatch.MathExpression(
    expression="incomingBytes / 300 / bytePerSecLimit",
    using_metrics={
        "incoming_bytes": delivery_stream.metric_incoming_bytes(statistic=cloudwatch.Statistic.SUM),
        "byte_per_sec_limit": delivery_stream.metric("BytesPerSecondLimit")
    }
)

cloudwatch.Alarm(self, "Alarm",
    metric=incoming_bytes_percent_of_limit,
    threshold=0.9,
    evaluation_periods=3
)

Attributes

AVERAGE

The value of Sum / SampleCount during the specified period.

MAXIMUM

The highest value observed during the specified period.

You can use this value to determine high volumes of activity for your application.

MINIMUM

The lowest value observed during the specified period.

You can use this value to determine low volumes of activity for your application.

SAMPLE_COUNT

The count (number) of data points used for the statistical calculation.

SUM

All values submitted for the matching metric added together.

This statistic can be useful for determining the total volume of a metric.