Stats Class
Factory functions for standard statistics strings.
Example
declare const dashboard: cloudwatch.Dashboard;
declare const executionCountMetric: cloudwatch.Metric;
declare const errorCountMetric: cloudwatch.Metric;
dashboard.addWidgets(new cloudwatch.GraphWidget({
title: "Executions vs error rate",
left: [executionCountMetric],
right: [errorCountMetric.with({
statistic: cloudwatch.Stats.AVERAGE,
label: "Error rate",
color: cloudwatch.Color.GREEN,
})]
}));
Initializer
new Stats()
Stats()
new Stats()
new Stats()
NewStats()
Properties
It is equivalent to trimmedMean(25, 75).
You can use this value to determine high volumes of activity for your application.
You can use this value to determine low volumes of activity for your application.
This statistic can be useful for determining the total volume of a metric.
Methods
p(percentile: number): string@staticmethod def p(percentile: int | float) -> strpublic static String p(Number percentile)public static string P(double percentile)func P(Percentile *float64) *stringstatic#percentile(percentile: number): string@staticmethod def percentile(percentile: int | float) -> strpublic static String percentile(Number percentile)public static string Percentile(double percentile)func Percentile(Percentile *float64) *stringstatic#notes
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.
percentileRank(v1: number, v2?: number): string@staticmethod def percentile_rank(v1: int | float, v2: typing.Optional[int | float] = None) -> strpublic static String percentileRank(Number v1, Number v2)public static string PercentileRank(double v1, double? v2 = null)func PercentileRank(V1 *float64, V2 *float64) *stringstatic#notes
- 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.
pr(v1: number, v2?: number): string@staticmethod def pr(v1: int | float, v2: typing.Optional[int | float] = None) -> strpublic static String pr(Number v1, Number v2)public static string Pr(double v1, double? v2 = null)func Pr(V1 *float64, V2 *float64) *stringstatic#tc(p1: number, p2?: number): string@staticmethod def tc(p1: int | float, p2: typing.Optional[int | float] = None) -> strpublic static String tc(Number p1, Number p2)public static string Tc(double p1, double? p2 = null)func Tc(P1 *float64, P2 *float64) *stringstatic#tm(p1: number, p2?: number): string@staticmethod def tm(p1: int | float, p2: typing.Optional[int | float] = None) -> strpublic static String tm(Number p1, Number p2)public static string Tm(double p1, double? p2 = null)func Tm(P1 *float64, P2 *float64) *stringstatic#trimmedCount(p1: number, p2?: number): string@staticmethod def trimmed_count(p1: int | float, p2: typing.Optional[int | float] = None) -> strpublic static String trimmedCount(Number p1, Number p2)public static string TrimmedCount(double p1, double? p2 = null)func TrimmedCount(P1 *float64, P2 *float64) *stringstatic#notes
- 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.
trimmedMean(p1: number, p2?: number): string@staticmethod def trimmed_mean(p1: int | float, p2: typing.Optional[int | float] = None) -> strpublic static String trimmedMean(Number p1, Number p2)public static string TrimmedMean(double p1, double? p2 = null)func TrimmedMean(P1 *float64, P2 *float64) *stringstatic#notes
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.
trimmedSum(p1: number, p2?: number): string@staticmethod def trimmed_sum(p1: int | float, p2: typing.Optional[int | float] = None) -> strpublic static String trimmedSum(Number p1, Number p2)public static string TrimmedSum(double p1, double? p2 = null)func TrimmedSum(P1 *float64, P2 *float64) *stringstatic#notes
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.
ts(p1: number, p2?: number): string@staticmethod def ts(p1: int | float, p2: typing.Optional[int | float] = None) -> strpublic static String ts(Number p1, Number p2)public static string Ts(double p1, double? p2 = null)func Ts(P1 *float64, P2 *float64) *stringstatic#winsorizedMean(p1: number, p2?: number): string@staticmethod def winsorized_mean(p1: int | float, p2: typing.Optional[int | float] = None) -> strpublic static String winsorizedMean(Number p1, Number p2)public static string WinsorizedMean(double p1, double? p2 = null)func WinsorizedMean(P1 *float64, P2 *float64) *stringstatic#notes
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.
wm(p1: number, p2?: number): string@staticmethod def wm(p1: int | float, p2: typing.Optional[int | float] = None) -> strpublic static String wm(Number p1, Number p2)public static string Wm(double p1, double? p2 = null)func Wm(P1 *float64, P2 *float64) *stringstatic#