A math expression built with metric(s) emitted by a service.
The math expression is a combination of an expression (x+y) and metrics to apply expression on. It also contains metadata which is used only in graphs, such as color and label. It makes sense to embed this in here, so that compound constructs can attach that metadata to metrics they expose.
This class does not represent a resource, so hence is not a construct. Instead, MathExpression is an abstraction that makes it easy to specify metrics for use in both alarms and graphs.
new MathExpression(props: MathExpressionProps)
|expression||The expression defining the metric.|
|period||Aggregation period of this metric.|
|using||The metrics used in the expression as KeyValuePair <id, metric>.|
|color?||The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The |
|label?||Label for this metric when added to a Graph.|
The expression defining the metric.
Aggregation period of this metric.
The metrics used in the expression as KeyValuePair <id, metric>.
The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The
Color class has a set of standard colors that can be used here.
Label for this metric when added to a Graph.
|create||Make a new Alarm for this metric.|
|to||Turn this metric object into an alarm configuration.|
|to||Turn this metric object into a graph configuration.|
|to||Inspect the details of the metric object.|
|to||Returns a string representation of an object.|
|with(props)||Return a copy of Metric with properties changed.|
Alarm(scope, id, props)
public createAlarm(scope: Construct, id: string, props: CreateAlarmOptions): Alarm
Make a new Alarm for this metric.
Combines both properties that may adjust the metric (aggregation) as well as alarm properties.
public toAlarmConfig(): MetricAlarmConfig
Turn this metric object into an alarm configuration.
public toGraphConfig(): MetricGraphConfig
Turn this metric object into a graph configuration.
public toMetricConfig(): MetricConfig
Inspect the details of the metric object.
public toString(): string
Returns a string representation of an object.
public with(props: MathExpressionOptions): MathExpression
Math— The set of properties to change.
Return a copy of Metric with properties changed.
All properties except namespace and metricName can be changed.