Class MetricProps.Builder

java.lang.Object
software.amazon.awscdk.services.cloudwatch.MetricProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<MetricProps>
Enclosing interface:
MetricProps

@Stability(Stable) public static final class MetricProps.Builder extends Object implements software.amazon.jsii.Builder<MetricProps>
A builder for MetricProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • metricName

      @Stability(Stable) public MetricProps.Builder metricName(String metricName)
      Sets the value of MetricProps.getMetricName()
      Parameters:
      metricName - Name of the metric. This parameter is required.
      Returns:
      this
    • namespace

      @Stability(Stable) public MetricProps.Builder namespace(String namespace)
      Sets the value of MetricProps.getNamespace()
      Parameters:
      namespace - Namespace of the metric. This parameter is required.
      Returns:
      this
    • account

      @Stability(Stable) public MetricProps.Builder account(String account)
      Parameters:
      account - Account which this metric comes from.
      Returns:
      this
    • color

      @Stability(Stable) public MetricProps.Builder color(String color)
      Parameters:
      color - 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.
      Returns:
      this
    • dimensions

      @Stability(Deprecated) @Deprecated public MetricProps.Builder dimensions(Map<String,? extends Object> dimensions)
      Deprecated.
      Use 'dimensionsMap' instead.
      Parameters:
      dimensions - Dimensions of the metric.
      Returns:
      this
    • dimensionsMap

      @Stability(Stable) public MetricProps.Builder dimensionsMap(Map<String,String> dimensionsMap)
      Parameters:
      dimensionsMap - Dimensions of the metric.
      Returns:
      this
    • label

      @Stability(Stable) public MetricProps.Builder label(String label)
      Parameters:
      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.

      Returns:
      this
    • period

      @Stability(Stable) public MetricProps.Builder period(Duration period)
      Parameters:
      period - The period over which the specified statistic is applied.
      Returns:
      this
    • region

      @Stability(Stable) public MetricProps.Builder region(String region)
      Parameters:
      region - Region which this metric comes from.
      Returns:
      this
    • statistic

      @Stability(Stable) public MetricProps.Builder statistic(String statistic)
      Parameters:
      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"
      Returns:
      this
    • unit

      @Stability(Stable) public MetricProps.Builder unit(Unit unit)
      Parameters:
      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.

      Returns:
      this
    • build

      @Stability(Stable) public MetricProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<MetricProps>
      Returns:
      a new instance of MetricProps
      Throws:
      NullPointerException - if any required attribute was not provided