Skip to content

Commit 483e744

Browse files
authored
feat: add 95th percentile core support (#55)
Adding support for 95th percentile and similar. Low level support only.
1 parent 4c397b5 commit 483e744

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

API.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45614,13 +45614,15 @@ create a two sets of dashboards: standard set (interactive) and a copy (bitmap).
4561445614
| <code><a href="#cdk-monitoring-constructs.LatencyType.P50">P50</a></code> | *No description.* |
4561545615
| <code><a href="#cdk-monitoring-constructs.LatencyType.P70">P70</a></code> | *No description.* |
4561645616
| <code><a href="#cdk-monitoring-constructs.LatencyType.P90">P90</a></code> | *No description.* |
45617+
| <code><a href="#cdk-monitoring-constructs.LatencyType.P95">P95</a></code> | *No description.* |
4561745618
| <code><a href="#cdk-monitoring-constructs.LatencyType.P99">P99</a></code> | *No description.* |
4561845619
| <code><a href="#cdk-monitoring-constructs.LatencyType.P999">P999</a></code> | *No description.* |
4561945620
| <code><a href="#cdk-monitoring-constructs.LatencyType.P9999">P9999</a></code> | *No description.* |
4562045621
| <code><a href="#cdk-monitoring-constructs.LatencyType.P100">P100</a></code> | *No description.* |
4562145622
| <code><a href="#cdk-monitoring-constructs.LatencyType.TM50">TM50</a></code> | *No description.* |
4562245623
| <code><a href="#cdk-monitoring-constructs.LatencyType.TM70">TM70</a></code> | *No description.* |
4562345624
| <code><a href="#cdk-monitoring-constructs.LatencyType.TM90">TM90</a></code> | *No description.* |
45625+
| <code><a href="#cdk-monitoring-constructs.LatencyType.TM95">TM95</a></code> | *No description.* |
4562445626
| <code><a href="#cdk-monitoring-constructs.LatencyType.TM99">TM99</a></code> | *No description.* |
4562545627
| <code><a href="#cdk-monitoring-constructs.LatencyType.TM999">TM999</a></code> | *No description.* |
4562645628
| <code><a href="#cdk-monitoring-constructs.LatencyType.TM9999">TM9999</a></code> | *No description.* |
@@ -45643,6 +45645,11 @@ create a two sets of dashboards: standard set (interactive) and a copy (bitmap).
4564345645
---
4564445646

4564545647

45648+
#### `P95` <a name="P95" id="cdk-monitoring-constructs.LatencyType.P95"></a>
45649+
45650+
---
45651+
45652+
4564645653
#### `P99` <a name="P99" id="cdk-monitoring-constructs.LatencyType.P99"></a>
4564745654

4564845655
---
@@ -45678,6 +45685,11 @@ create a two sets of dashboards: standard set (interactive) and a copy (bitmap).
4567845685
---
4567945686

4568045687

45688+
#### `TM95` <a name="TM95" id="cdk-monitoring-constructs.LatencyType.TM95"></a>
45689+
45690+
---
45691+
45692+
4568145693
#### `TM99` <a name="TM99" id="cdk-monitoring-constructs.LatencyType.TM99"></a>
4568245694

4568345695
---
@@ -45726,13 +45738,15 @@ Level of a given log.
4572645738
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.P50">P50</a></code> | 50th percentile of all datapoints. |
4572745739
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.P70">P70</a></code> | 70th percentile of all datapoints. |
4572845740
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.P90">P90</a></code> | 90th percentile of all datapoints. |
45741+
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.P95">P95</a></code> | 95th percentile of all datapoints. |
4572945742
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.P99">P99</a></code> | 99th percentile of all datapoints. |
4573045743
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.P999">P999</a></code> | 99.9th percentile of all datapoints. |
4573145744
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.P9999">P9999</a></code> | 99.99th percentile of all datapoints. |
4573245745
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.P100">P100</a></code> | 100th percentile of all datapoints. |
4573345746
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.TM50">TM50</a></code> | trimmed mean; |
4573445747
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.TM70">TM70</a></code> | trimmed mean; |
4573545748
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.TM90">TM90</a></code> | trimmed mean; |
45749+
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.TM95">TM95</a></code> | trimmed mean; |
4573645750
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.TM99">TM99</a></code> | trimmed mean; |
4573745751
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.TM999">TM999</a></code> | trimmed mean; |
4573845752
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.TM9999">TM9999</a></code> | trimmed mean; |
@@ -45746,6 +45760,7 @@ Level of a given log.
4574645760
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.WM50">WM50</a></code> | winsorized mean; |
4574745761
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.WM70">WM70</a></code> | winsorized mean; |
4574845762
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.WM90">WM90</a></code> | winsorized mean; |
45763+
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.WM95">WM95</a></code> | winsorized mean; |
4574945764
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.WM99">WM99</a></code> | winsorized mean; |
4575045765
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.WM999">WM999</a></code> | winsorized mean; |
4575145766
| <code><a href="#cdk-monitoring-constructs.MetricStatistic.WM9999">WM9999</a></code> | winsorized mean; |
@@ -45789,6 +45804,13 @@ Metric aggregation statistic to be used with the IMetric objects.
4578945804
---
4579045805

4579145806

45807+
#### `P95` <a name="P95" id="cdk-monitoring-constructs.MetricStatistic.P95"></a>
45808+
45809+
95th percentile of all datapoints.
45810+
45811+
---
45812+
45813+
4579245814
#### `P99` <a name="P99" id="cdk-monitoring-constructs.MetricStatistic.P99"></a>
4579345815

4579445816
99th percentile of all datapoints.
@@ -45844,6 +45866,15 @@ calculates the average after removing the 10% of data points with the highest va
4584445866
---
4584545867

4584645868

45869+
#### `TM95` <a name="TM95" id="cdk-monitoring-constructs.MetricStatistic.TM95"></a>
45870+
45871+
trimmed mean;
45872+
45873+
calculates the average after removing the 5% of data points with the highest values
45874+
45875+
---
45876+
45877+
4584745878
#### `TM99` <a name="TM99" id="cdk-monitoring-constructs.MetricStatistic.TM99"></a>
4584845879

4584945880
trimmed mean;
@@ -45961,6 +45992,15 @@ calculates the average while treating the 10% of the highest values to be equal
4596145992
---
4596245993

4596345994

45995+
#### `WM95` <a name="WM95" id="cdk-monitoring-constructs.MetricStatistic.WM95"></a>
45996+
45997+
winsorized mean;
45998+
45999+
calculates the average while treating the 5% of the highest values to be equal to the value at the 95th percentile
46000+
46001+
---
46002+
46003+
4596446004
#### `WM99` <a name="WM99" id="cdk-monitoring-constructs.MetricStatistic.WM99"></a>
4596546005

4596646006
winsorized mean;

lib/common/metric/MetricStatistic.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export enum MetricStatistic {
1616
* 90th percentile of all datapoints
1717
*/
1818
P90 = "p90",
19+
/**
20+
* 95th percentile of all datapoints
21+
*/
22+
P95 = "p95",
1923
/**
2024
* 99th percentile of all datapoints
2125
*/
@@ -45,6 +49,10 @@ export enum MetricStatistic {
4549
* trimmed mean; calculates the average after removing the 10% of data points with the highest values
4650
*/
4751
TM90 = "tm90",
52+
/**
53+
* trimmed mean; calculates the average after removing the 5% of data points with the highest values
54+
*/
55+
TM95 = "tm95",
4856
/**
4957
* trimmed mean; calculates the average after removing the 1% of data points with the highest values
5058
*/
@@ -98,6 +106,10 @@ export enum MetricStatistic {
98106
* winsorized mean; calculates the average while treating the 10% of the highest values to be equal to the value at the 90th percentile
99107
*/
100108
WM90 = "wm90",
109+
/**
110+
* winsorized mean; calculates the average while treating the 5% of the highest values to be equal to the value at the 95th percentile
111+
*/
112+
WM95 = "wm95",
101113
/**
102114
* winsorized mean; calculates the average while treating the 1% of the highest values to be equal to the value at the 99th percentile
103115
*/

lib/common/monitoring/alarms/LatencyAlarmFactory.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ export enum LatencyType {
88
P50 = "P50",
99
P70 = "P70",
1010
P90 = "P90",
11+
P95 = "P95",
1112
P99 = "P99",
1213
P999 = "P999",
1314
P9999 = "P9999",
1415
P100 = "P100",
1516
TM50 = "TM50",
1617
TM70 = "TM70",
1718
TM90 = "TM90",
19+
TM95 = "TM95",
1820
TM99 = "TM99",
1921
TM999 = "TM999",
2022
TM9999 = "TM9999",
@@ -29,6 +31,8 @@ export function getLatencyTypeStatistic(latencyType: LatencyType) {
2931
return MetricStatistic.P70;
3032
case LatencyType.P90:
3133
return MetricStatistic.P90;
34+
case LatencyType.P95:
35+
return MetricStatistic.P95;
3236
case LatencyType.P99:
3337
return MetricStatistic.P99;
3438
case LatencyType.P999:
@@ -43,6 +47,8 @@ export function getLatencyTypeStatistic(latencyType: LatencyType) {
4347
return MetricStatistic.TM70;
4448
case LatencyType.TM90:
4549
return MetricStatistic.TM90;
50+
case LatencyType.TM95:
51+
return MetricStatistic.TM95;
4652
case LatencyType.TM99:
4753
return MetricStatistic.TM99;
4854
case LatencyType.TM999:
@@ -63,6 +69,7 @@ export function getLatencyTypeExpressionId(latencyType: LatencyType) {
6369
case LatencyType.P50:
6470
case LatencyType.P70:
6571
case LatencyType.P90:
72+
case LatencyType.P95:
6673
case LatencyType.P99:
6774
case LatencyType.P999:
6875
case LatencyType.P9999:

0 commit comments

Comments
 (0)