Skip to content

Commit

Permalink
Merge branch 'main' into automation/yarn-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Mar 15, 2024
2 parents bb5b100 + 3d14b3b commit 16a6330
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"Arn"
]
},
"Runtime": "python3.9",
"Runtime": "python3.11",
"Timeout": 300
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
"Arn"
]
},
"Runtime": "python3.9",
"Runtime": "python3.11",
"Timeout": 300
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
"Arn"
]
},
"Runtime": "python3.9",
"Runtime": "python3.11",
"Timeout": 300
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
"Arn"
]
},
"Runtime": "python3.9",
"Runtime": "python3.11",
"Timeout": 300
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"Arn"
]
},
"Runtime": "python3.9",
"Runtime": "python3.11",
"Timeout": 300
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@
"Arn"
]
},
"Runtime": "python3.9",
"Runtime": "python3.11",
"Timeout": 300
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"Arn"
]
},
"Runtime": "python3.9",
"Runtime": "python3.11",
"Timeout": 300
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"Arn"
]
},
"Runtime": "python3.9",
"Runtime": "python3.11",
"Timeout": 300
},
"DependsOn": [
Expand Down
9 changes: 9 additions & 0 deletions packages/aws-cdk-lib/aws-cloudwatch/lib/private/statistic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export interface PercentileStatistic extends SingleStatistic {
statName: 'percentile';
}

export interface PercentileRankStatistic extends PairStatistic {
statName: 'percentileRank';
}

export interface TrimmedMeanStatistic extends PairStatistic {
statName: 'trimmedMean';
}
Expand Down Expand Up @@ -154,6 +158,7 @@ export function parseStatistic(
):
| SimpleStatistic
| PercentileStatistic
| PercentileRankStatistic
| TrimmedMeanStatistic
| WinsorizedMeanStatistic
| TrimmedCountStatistic
Expand Down Expand Up @@ -188,6 +193,10 @@ export function parseStatistic(
m = parseSingleStatistic(stat, 'p');
if (m) return { ...m, statName: 'percentile' } as PercentileStatistic;

// Percentile Rank statistics
m = parsePairStatistic(stat, 'pr');
if (m) return { ...m, statName: 'percentileRank' } as PercentileRankStatistic;

// Trimmed mean statistics
m = parseSingleStatistic(stat, 'tm') || parsePairStatistic(stat, 'tm');
if (m) return { ...m, statName: 'trimmedMean' } as TrimmedMeanStatistic;
Expand Down
15 changes: 15 additions & 0 deletions packages/aws-cdk-lib/aws-cloudwatch/test/stats.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
import { Metric, Stats } from '../../aws-cloudwatch';
import * as cloudwatch from '../lib';

it.each([
Stats.percentileRank(0),
Stats.percentileRank(0, 1),
Stats.percentileRank(0, undefined),
])('Stats can create valid statistics %s without causing warnings', (statistic) => {
const metric = new Metric({
namespace: 'example',
metricName: 'example',
statistic,
});

expect(metric.warningsV2).toEqual(undefined);
});

test('spot check some constants', () => {
expect(cloudwatch.Stats.AVERAGE).toEqual('Average');
expect(cloudwatch.Stats.IQM).toEqual('IQM');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class NotificationsResourceHandler extends Construct {
Code: { ZipFile: handlerSourceWithoutComments },
Handler: 'index.handler',
Role: this.role.roleArn,
Runtime: 'python3.9',
Runtime: 'python3.11',
Timeout: 300,
},
});
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-s3/test/notification.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe('notification', () => {
});

Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {
Runtime: 'python3.9',
Runtime: 'python3.11',
});
});
});

0 comments on commit 16a6330

Please sign in to comment.