Class Metric.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<Metric>
- Enclosing class:
- Metric
Metric
.-
Method Summary
Modifier and TypeMethodDescriptionAccount which this metric comes from.build()
The hex color code, prefixed with '#' (e.g.static Metric.Builder
create()
dimensions
(Map<String, ? extends Object> dimensions) Deprecated.Use 'dimensionsMap' instead.dimensionsMap
(Map<String, String> dimensionsMap) Dimensions of the metric.Label for this metric when added to a Graph in a Dashboard.metricName
(String metricName) Name of the metric.Namespace of the metric.The period over which the specified statistic is applied.Region which this metric comes from.What function to use for aggregating.Unit used to filter the metric stream.
-
Method Details
-
create
- Returns:
- a new instance of
Metric.Builder
.
-
account
Account which this metric comes from.Default: - Deployment account.
- Parameters:
account
- Account which this metric comes from. This parameter is required.- Returns:
this
-
color
The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here.Default: - Automatic color
- Parameters:
color
- The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. This parameter is required.- Returns:
this
-
dimensions
@Stability(Deprecated) @Deprecated public Metric.Builder dimensions(Map<String, ? extends Object> dimensions) Deprecated.Use 'dimensionsMap' instead.(deprecated) Dimensions of the metric.Default: - No dimensions.
- Parameters:
dimensions
- Dimensions of the metric. This parameter is required.- Returns:
this
-
dimensionsMap
Dimensions of the metric.Default: - No dimensions.
- Parameters:
dimensionsMap
- Dimensions of the metric. This parameter is required.- Returns:
this
-
label
Label for this metric when added to a Graph in a Dashboard.You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:
[max: ${MAX}] MyMetric
As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.
Default: - No label
- Parameters:
label
- Label for this metric when added to a Graph in a Dashboard. This parameter is required.- Returns:
this
-
period
The period over which the specified statistic is applied.Default: Duration.minutes(5)
- Parameters:
period
- The period over which the specified statistic is applied. This parameter is required.- Returns:
this
-
region
Region which this metric comes from.Default: - Deployment region.
- Parameters:
region
- Region which this metric comes from. This parameter is required.- Returns:
this
-
statistic
What function to use for aggregating.Can be one of the following:
- "Minimum" | "min"
- "Maximum" | "max"
- "Average" | "avg"
- "Sum" | "sum"
- "SampleCount | "n"
- "pNN.NN"
Default: Average
- Parameters:
statistic
- What function to use for aggregating. This parameter is required.- Returns:
this
-
unit
Unit used to filter the metric stream.Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.
The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.
CloudWatch does not honor this property for graphs.
Default: - All metric datums in the given metric stream
- Parameters:
unit
- Unit used to filter the metric stream. This parameter is required.- Returns:
this
-
metricName
Name of the metric.- Parameters:
metricName
- Name of the metric. This parameter is required.- Returns:
this
-
namespace
Namespace of the metric.- Parameters:
namespace
- Namespace of the metric. This parameter is required.- Returns:
this
-
build
-