java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudwatch.Stats
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-27T16:50:54.542Z") @Stability(Stable) public abstract class Stats extends software.amazon.jsii.JsiiObject
Factory functions for standard statistics strings.

Example:

 Dashboard dashboard;
 Metric executionCountMetric;
 Metric errorCountMetric;
 dashboard.addWidgets(GraphWidget.Builder.create()
         .title("Executions vs error rate")
         .left(List.of(executionCountMetric))
         .right(List.of(errorCountMetric.with(MetricOptions.builder()
                 .statistic(Stats.AVERAGE)
                 .label("Error rate")
                 .color(Color.GREEN)
                 .build())))
         .build());
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The value of Sum / SampleCount during the specified period.
    static final String
    Interquartile mean (IQM) is the trimmed mean of the interquartile range, or the middle 50% of values.
    static final String
    The highest value observed during the specified period.
    static final String
    The lowest value observed during the specified period.
    static final String
    The count (number) of data points used for the statistical calculation.
    static final String
    All values submitted for the matching metric added together.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    Stats(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Stats(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    p(Number percentile)
    A shorter alias for percentile().
    static String
    percentile(Number percentile)
    Percentile indicates the relative standing of a value in a dataset.
    static String
    Percentile rank (PR) is the percentage of values that meet a fixed threshold.
    static String
    Percentile rank (PR) is the percentage of values that meet a fixed threshold.
    static String
    pr(Number v1)
    Shorter alias for percentileRank().
    static String
    pr(Number v1, Number v2)
    Shorter alias for percentileRank().
    static String
    tc(Number p1)
    Shorter alias for trimmedCount().
    static String
    tc(Number p1, Number p2)
    Shorter alias for trimmedCount().
    static String
    tm(Number p1)
    A shorter alias for trimmedMean().
    static String
    tm(Number p1, Number p2)
    A shorter alias for trimmedMean().
    static String
    Trimmed count (TC) is the number of data points in the chosen range for a trimmed mean statistic.
    static String
    Trimmed count (TC) is the number of data points in the chosen range for a trimmed mean statistic.
    static String
    Trimmed mean (TM) is the mean of all values that are between two specified boundaries.
    static String
    Trimmed mean (TM) is the mean of all values that are between two specified boundaries.
    static String
    Trimmed sum (TS) is the sum of the values of data points in a chosen range for a trimmed mean statistic.
    static String
    Trimmed sum (TS) is the sum of the values of data points in a chosen range for a trimmed mean statistic.
    static String
    ts(Number p1)
    Shorter alias for trimmedSum().
    static String
    ts(Number p1, Number p2)
    Shorter alias for trimmedSum().
    static String
    Winsorized mean (WM) is similar to trimmed mean.
    static String
    Winsorized mean (WM) is similar to trimmed mean.
    static String
    wm(Number p1)
    A shorter alias for winsorizedMean().
    static String
    wm(Number p1, Number p2)
    A shorter alias for winsorizedMean().

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Field Details

    • AVERAGE

      @Stability(Stable) public static final String AVERAGE
      The value of Sum / SampleCount during the specified period.
    • IQM

      @Stability(Stable) public static final String IQM
      Interquartile mean (IQM) is the trimmed mean of the interquartile range, or the middle 50% of values.

      It is equivalent to trimmedMean(25, 75).

    • MAXIMUM

      @Stability(Stable) public static final String MAXIMUM
      The highest value observed during the specified period.

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

    • MINIMUM

      @Stability(Stable) public static final String 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

      @Stability(Stable) public static final String SAMPLE_COUNT
      The count (number) of data points used for the statistical calculation.
    • SUM

      @Stability(Stable) public static final String SUM
      All values submitted for the matching metric added together.

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

  • Constructor Details

    • Stats

      protected Stats(software.amazon.jsii.JsiiObjectRef objRef)
    • Stats

      protected Stats(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Stats

      @Stability(Stable) protected Stats()
  • Method Details

    • p

      @Stability(Stable) @NotNull public static String p(@NotNull Number percentile)
      A shorter alias for percentile().

      Parameters:
      percentile - This parameter is required.
    • percentile

      @Stability(Stable) @NotNull public static String percentile(@NotNull Number percentile)
      Percentile indicates the relative standing of a value in a dataset.

      Percentiles help you get a better understanding of the distribution of your metric data.

      For example, p(90) is the 90th percentile and means that 90% of the data within the period is lower than this value and 10% of the data is higher than this value.

      Parameters:
      percentile - This parameter is required.
    • percentileRank

      @Stability(Stable) @NotNull public static String percentileRank(@NotNull Number v1, @Nullable Number v2)
      Percentile rank (PR) is the percentage of values that meet a fixed threshold.

      • If two numbers are given, they define the lower and upper bounds in absolute values, respectively.
      • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

      For example, percentileRank(300) returns the percentage of data points that have a value of 300 or less. percentileRank(100, 2000) returns the percentage of data points that have a value between 100 and 2000.

      Parameters:
      v1 - This parameter is required.
      v2 -
    • percentileRank

      @Stability(Stable) @NotNull public static String percentileRank(@NotNull Number v1)
      Percentile rank (PR) is the percentage of values that meet a fixed threshold.

      • If two numbers are given, they define the lower and upper bounds in absolute values, respectively.
      • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

      For example, percentileRank(300) returns the percentage of data points that have a value of 300 or less. percentileRank(100, 2000) returns the percentage of data points that have a value between 100 and 2000.

      Parameters:
      v1 - This parameter is required.
    • pr

      @Stability(Stable) @NotNull public static String pr(@NotNull Number v1, @Nullable Number v2)
      Shorter alias for percentileRank().

      Parameters:
      v1 - This parameter is required.
      v2 -
    • pr

      @Stability(Stable) @NotNull public static String pr(@NotNull Number v1)
      Shorter alias for percentileRank().

      Parameters:
      v1 - This parameter is required.
    • tc

      @Stability(Stable) @NotNull public static String tc(@NotNull Number p1, @Nullable Number p2)
      Shorter alias for trimmedCount().

      Parameters:
      p1 - This parameter is required.
      p2 -
    • tc

      @Stability(Stable) @NotNull public static String tc(@NotNull Number p1)
      Shorter alias for trimmedCount().

      Parameters:
      p1 - This parameter is required.
    • tm

      @Stability(Stable) @NotNull public static String tm(@NotNull Number p1, @Nullable Number p2)
      A shorter alias for trimmedMean().

      Parameters:
      p1 - This parameter is required.
      p2 -
    • tm

      @Stability(Stable) @NotNull public static String tm(@NotNull Number p1)
      A shorter alias for trimmedMean().

      Parameters:
      p1 - This parameter is required.
    • trimmedCount

      @Stability(Stable) @NotNull public static String trimmedCount(@NotNull Number p1, @Nullable Number p2)
      Trimmed count (TC) is the number of data points in the chosen range for a trimmed mean statistic.

      • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
      • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

      For example, tc(90) returns the number of data points not including any data points that fall in the highest 10% of the values. tc(10, 90) returns the number of data points not including any data points that fall in the lowest 10% of the values and the highest 90% of the values.

      Parameters:
      p1 - This parameter is required.
      p2 -
    • trimmedCount

      @Stability(Stable) @NotNull public static String trimmedCount(@NotNull Number p1)
      Trimmed count (TC) is the number of data points in the chosen range for a trimmed mean statistic.

      • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
      • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

      For example, tc(90) returns the number of data points not including any data points that fall in the highest 10% of the values. tc(10, 90) returns the number of data points not including any data points that fall in the lowest 10% of the values and the highest 90% of the values.

      Parameters:
      p1 - This parameter is required.
    • trimmedMean

      @Stability(Stable) @NotNull public static String trimmedMean(@NotNull Number p1, @Nullable Number p2)
      Trimmed mean (TM) is the mean of all values that are between two specified boundaries.

      Values outside of the boundaries are ignored when the mean is calculated. You define the boundaries as one or two numbers between 0 and 100, up to 10 decimal places. The numbers are percentages.

      • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
      • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

      For example, tm(90) calculates the average after removing the 10% of data points with the highest values; tm(10, 90) calculates the average after removing the 10% with the lowest and 10% with the highest values.

      Parameters:
      p1 - This parameter is required.
      p2 -
    • trimmedMean

      @Stability(Stable) @NotNull public static String trimmedMean(@NotNull Number p1)
      Trimmed mean (TM) is the mean of all values that are between two specified boundaries.

      Values outside of the boundaries are ignored when the mean is calculated. You define the boundaries as one or two numbers between 0 and 100, up to 10 decimal places. The numbers are percentages.

      • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
      • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

      For example, tm(90) calculates the average after removing the 10% of data points with the highest values; tm(10, 90) calculates the average after removing the 10% with the lowest and 10% with the highest values.

      Parameters:
      p1 - This parameter is required.
    • trimmedSum

      @Stability(Stable) @NotNull public static String trimmedSum(@NotNull Number p1, @Nullable Number p2)
      Trimmed sum (TS) is the sum of the values of data points in a chosen range for a trimmed mean statistic.

      It is equivalent to (Trimmed Mean) * (Trimmed count).

      • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
      • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

      For example, ts(90) returns the sum of the data points not including any data points that fall in the highest 10% of the values. ts(10, 90) returns the sum of the data points not including any data points that fall in the lowest 10% of the values and the highest 90% of the values.

      Parameters:
      p1 - This parameter is required.
      p2 -
    • trimmedSum

      @Stability(Stable) @NotNull public static String trimmedSum(@NotNull Number p1)
      Trimmed sum (TS) is the sum of the values of data points in a chosen range for a trimmed mean statistic.

      It is equivalent to (Trimmed Mean) * (Trimmed count).

      • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
      • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

      For example, ts(90) returns the sum of the data points not including any data points that fall in the highest 10% of the values. ts(10, 90) returns the sum of the data points not including any data points that fall in the lowest 10% of the values and the highest 90% of the values.

      Parameters:
      p1 - This parameter is required.
    • ts

      @Stability(Stable) @NotNull public static String ts(@NotNull Number p1, @Nullable Number p2)
      Shorter alias for trimmedSum().

      Parameters:
      p1 - This parameter is required.
      p2 -
    • ts

      @Stability(Stable) @NotNull public static String ts(@NotNull Number p1)
      Shorter alias for trimmedSum().

      Parameters:
      p1 - This parameter is required.
    • winsorizedMean

      @Stability(Stable) @NotNull public static String winsorizedMean(@NotNull Number p1, @Nullable Number p2)
      Winsorized mean (WM) is similar to trimmed mean.

      However, with winsorized mean, the values that are outside the boundary are not ignored, but instead are considered to be equal to the value at the edge of the appropriate boundary. After this normalization, the average is calculated. You define the boundaries as one or two numbers between 0 and 100, up to 10 decimal places.

      • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
      • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

      For example, tm(90) calculates the average after removing the 10% of data points with the highest values; tm(10, 90) calculates the average after removing the 10% with the lowest and 10% with the highest values.

      For example, wm(90) calculates the average while treating the 10% of the highest values to be equal to the value at the 90th percentile. wm(10, 90) calculates the average while treaing the bottom 10% and the top 10% of values to be equal to the boundary values.

      Parameters:
      p1 - This parameter is required.
      p2 -
    • winsorizedMean

      @Stability(Stable) @NotNull public static String winsorizedMean(@NotNull Number p1)
      Winsorized mean (WM) is similar to trimmed mean.

      However, with winsorized mean, the values that are outside the boundary are not ignored, but instead are considered to be equal to the value at the edge of the appropriate boundary. After this normalization, the average is calculated. You define the boundaries as one or two numbers between 0 and 100, up to 10 decimal places.

      • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
      • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

      For example, tm(90) calculates the average after removing the 10% of data points with the highest values; tm(10, 90) calculates the average after removing the 10% with the lowest and 10% with the highest values.

      For example, wm(90) calculates the average while treating the 10% of the highest values to be equal to the value at the 90th percentile. wm(10, 90) calculates the average while treaing the bottom 10% and the top 10% of values to be equal to the boundary values.

      Parameters:
      p1 - This parameter is required.
    • wm

      @Stability(Stable) @NotNull public static String wm(@NotNull Number p1, @Nullable Number p2)
      A shorter alias for winsorizedMean().

      Parameters:
      p1 - This parameter is required.
      p2 -
    • wm

      @Stability(Stable) @NotNull public static String wm(@NotNull Number p1)
      A shorter alias for winsorizedMean().

      Parameters:
      p1 - This parameter is required.