Skip to content

Commit 16a6330

Browse files
authored
Merge branch 'main' into automation/yarn-upgrade
2 parents bb5b100 + 3d14b3b commit 16a6330

12 files changed

Lines changed: 34 additions & 10 deletions

File tree

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.s3.imported-bucket.js.snapshot/tester.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
"Arn"
179179
]
180180
},
181-
"Runtime": "python3.9",
181+
"Runtime": "python3.11",
182182
"Timeout": 300
183183
},
184184
"DependsOn": [

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.s3.js.snapshot/lambda-event-source-s3.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@
323323
"Arn"
324324
]
325325
},
326-
"Runtime": "python3.9",
326+
"Runtime": "python3.11",
327327
"Timeout": 300
328328
},
329329
"DependsOn": [

packages/@aws-cdk-testing/framework-integ/test/aws-s3-notifications/test/integ.notifications.js.snapshot/test-3.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
"Arn"
255255
]
256256
},
257-
"Runtime": "python3.9",
257+
"Runtime": "python3.11",
258258
"Timeout": 300
259259
},
260260
"DependsOn": [

packages/@aws-cdk-testing/framework-integ/test/aws-s3-notifications/test/lambda/integ.bucket-notifications.js.snapshot/cdk-integ-lambda-bucket-notifications.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
"Arn"
247247
]
248248
},
249-
"Runtime": "python3.9",
249+
"Runtime": "python3.11",
250250
"Timeout": 300
251251
},
252252
"DependsOn": [

packages/@aws-cdk-testing/framework-integ/test/aws-s3-notifications/test/sns/integ.sns-bucket-notifications.js.snapshot/sns-bucket-notifications.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
"Arn"
205205
]
206206
},
207-
"Runtime": "python3.9",
207+
"Runtime": "python3.11",
208208
"Timeout": 300
209209
},
210210
"DependsOn": [

packages/@aws-cdk-testing/framework-integ/test/aws-s3-notifications/test/sqs/integ.bucket-notifications-unmanaged.js.snapshot/integ-sqs-bucket-notifications.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@
412412
"Arn"
413413
]
414414
},
415-
"Runtime": "python3.9",
415+
"Runtime": "python3.11",
416416
"Timeout": 300
417417
},
418418
"DependsOn": [

packages/@aws-cdk-testing/framework-integ/test/aws-s3-notifications/test/sqs/integ.bucket-notifications.js.snapshot/sqs-bucket-notifications.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
"Arn"
194194
]
195195
},
196-
"Runtime": "python3.9",
196+
"Runtime": "python3.11",
197197
"Timeout": 300
198198
},
199199
"DependsOn": [

packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket.notifications.js.snapshot/aws-cdk-s3-notifications.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"Arn"
9090
]
9191
},
92-
"Runtime": "python3.9",
92+
"Runtime": "python3.11",
9393
"Timeout": 300
9494
},
9595
"DependsOn": [

packages/aws-cdk-lib/aws-cloudwatch/lib/private/statistic.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export interface PercentileStatistic extends SingleStatistic {
3434
statName: 'percentile';
3535
}
3636

37+
export interface PercentileRankStatistic extends PairStatistic {
38+
statName: 'percentileRank';
39+
}
40+
3741
export interface TrimmedMeanStatistic extends PairStatistic {
3842
statName: 'trimmedMean';
3943
}
@@ -154,6 +158,7 @@ export function parseStatistic(
154158
):
155159
| SimpleStatistic
156160
| PercentileStatistic
161+
| PercentileRankStatistic
157162
| TrimmedMeanStatistic
158163
| WinsorizedMeanStatistic
159164
| TrimmedCountStatistic
@@ -188,6 +193,10 @@ export function parseStatistic(
188193
m = parseSingleStatistic(stat, 'p');
189194
if (m) return { ...m, statName: 'percentile' } as PercentileStatistic;
190195

196+
// Percentile Rank statistics
197+
m = parsePairStatistic(stat, 'pr');
198+
if (m) return { ...m, statName: 'percentileRank' } as PercentileRankStatistic;
199+
191200
// Trimmed mean statistics
192201
m = parseSingleStatistic(stat, 'tm') || parsePairStatistic(stat, 'tm');
193202
if (m) return { ...m, statName: 'trimmedMean' } as TrimmedMeanStatistic;

packages/aws-cdk-lib/aws-cloudwatch/test/stats.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1+
import { Metric, Stats } from '../../aws-cloudwatch';
12
import * as cloudwatch from '../lib';
23

4+
it.each([
5+
Stats.percentileRank(0),
6+
Stats.percentileRank(0, 1),
7+
Stats.percentileRank(0, undefined),
8+
])('Stats can create valid statistics %s without causing warnings', (statistic) => {
9+
const metric = new Metric({
10+
namespace: 'example',
11+
metricName: 'example',
12+
statistic,
13+
});
14+
15+
expect(metric.warningsV2).toEqual(undefined);
16+
});
17+
318
test('spot check some constants', () => {
419
expect(cloudwatch.Stats.AVERAGE).toEqual('Average');
520
expect(cloudwatch.Stats.IQM).toEqual('IQM');

0 commit comments

Comments
 (0)