java.lang.Object
java.lang.Enum<Unit>
software.amazon.awscdk.services.cloudwatch.Unit
All Implemented Interfaces:
Serializable, Comparable<Unit>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.99.0 (build 8f757e4)", date="2024-06-13T18:49:15.881Z") @Stability(Stable) public enum Unit extends Enum<Unit>
Unit for metric.

Example:

 LogGroup logGroup;
 MetricFilter mf = MetricFilter.Builder.create(this, "MetricFilter")
         .logGroup(logGroup)
         .metricNamespace("MyApp")
         .metricName("Latency")
         .filterPattern(FilterPattern.exists("$.latency"))
         .metricValue("$.latency")
         .dimensions(Map.of(
                 "ErrorCode", "$.errorCode"))
         .unit(Unit.MILLISECONDS)
         .build();
 //expose a metric from the metric filter
 Metric metric = mf.metric();
 //you can use the metric to create a new alarm
 //you can use the metric to create a new alarm
 Alarm.Builder.create(this, "alarm from metric filter")
         .metric(metric)
         .threshold(100)
         .evaluationPeriods(2)
         .build();
 
  • Enum Constant Details

    • SECONDS

      @Stability(Stable) public static final Unit SECONDS
      Seconds.
    • MICROSECONDS

      @Stability(Stable) public static final Unit MICROSECONDS
      Microseconds.
    • MILLISECONDS

      @Stability(Stable) public static final Unit MILLISECONDS
      Milliseconds.
    • BYTES

      @Stability(Stable) public static final Unit BYTES
      Bytes.
    • KILOBYTES

      @Stability(Stable) public static final Unit KILOBYTES
      Kilobytes.
    • MEGABYTES

      @Stability(Stable) public static final Unit MEGABYTES
      Megabytes.
    • GIGABYTES

      @Stability(Stable) public static final Unit GIGABYTES
      Gigabytes.
    • TERABYTES

      @Stability(Stable) public static final Unit TERABYTES
      Terabytes.
    • BITS

      @Stability(Stable) public static final Unit BITS
      Bits.
    • KILOBITS

      @Stability(Stable) public static final Unit KILOBITS
      Kilobits.
    • MEGABITS

      @Stability(Stable) public static final Unit MEGABITS
      Megabits.
    • GIGABITS

      @Stability(Stable) public static final Unit GIGABITS
      Gigabits.
    • TERABITS

      @Stability(Stable) public static final Unit TERABITS
      Terabits.
    • PERCENT

      @Stability(Stable) public static final Unit PERCENT
      Percent.
    • COUNT

      @Stability(Stable) public static final Unit COUNT
      Count.
    • BYTES_PER_SECOND

      @Stability(Stable) public static final Unit BYTES_PER_SECOND
      Bytes/second (B/s).
    • KILOBYTES_PER_SECOND

      @Stability(Stable) public static final Unit KILOBYTES_PER_SECOND
      Kilobytes/second (kB/s).
    • MEGABYTES_PER_SECOND

      @Stability(Stable) public static final Unit MEGABYTES_PER_SECOND
      Megabytes/second (MB/s).
    • GIGABYTES_PER_SECOND

      @Stability(Stable) public static final Unit GIGABYTES_PER_SECOND
      Gigabytes/second (GB/s).
    • TERABYTES_PER_SECOND

      @Stability(Stable) public static final Unit TERABYTES_PER_SECOND
      Terabytes/second (TB/s).
    • BITS_PER_SECOND

      @Stability(Stable) public static final Unit BITS_PER_SECOND
      Bits/second (b/s).
    • KILOBITS_PER_SECOND

      @Stability(Stable) public static final Unit KILOBITS_PER_SECOND
      Kilobits/second (kb/s).
    • MEGABITS_PER_SECOND

      @Stability(Stable) public static final Unit MEGABITS_PER_SECOND
      Megabits/second (Mb/s).
    • GIGABITS_PER_SECOND

      @Stability(Stable) public static final Unit GIGABITS_PER_SECOND
      Gigabits/second (Gb/s).
    • TERABITS_PER_SECOND

      @Stability(Stable) public static final Unit TERABITS_PER_SECOND
      Terabits/second (Tb/s).
    • COUNT_PER_SECOND

      @Stability(Stable) public static final Unit COUNT_PER_SECOND
      Count/second.
    • NONE

      @Stability(Stable) public static final Unit NONE
      None.
  • Method Details

    • values

      public static Unit[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Unit valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null