Skip to content

Commit

Permalink
Changing dimension limit from 10 -> 30 for Metric
Browse files Browse the repository at this point in the history
  • Loading branch information
ruvimrd committed Feb 29, 2024
1 parent 9a0bf7a commit 29d4f37
Showing 1 changed file with 44 additions and 4 deletions.
48 changes: 44 additions & 4 deletions packages/aws-cdk-lib/aws-cloudwatch/test/metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('Metrics', () => {

});

testDeprecated('throws error when there are more than 10 dimensions', () => {
testDeprecated('throws error when there are more than 30 dimensions', () => {
expect(() => {
new Metric({
namespace: 'Test',
Expand All @@ -130,13 +130,33 @@ describe('Metrics', () => {
dimensionI: 'value9',
dimensionJ: 'value10',
dimensionK: 'value11',
dimensionL: 'value12',
dimensionM: 'value13',
dimensionN: 'value14',
dimensionO: 'value15',
dimensionP: 'value16',
dimensionQ: 'value17',
dimensionR: 'value18',
dimensionS: 'value19',
dimensionT: 'value20',
dimensionU: 'value21',
dimensionV: 'value22',
dimensionW: 'value23',
dimensionX: 'value24',
dimensionY: 'value25',
dimensionZ: 'value26',
dimensionAA: 'value27',
dimensionAB: 'value28',
dimensionAC: 'value29',
dimensionAD: 'value30',
dimensionAE: 'value31',
},
} );
}).toThrow(/The maximum number of dimensions is 10, received 11/);
}).toThrow(/The maximum number of dimensions is 30, received 31/);

});

test('throws error when there are more than 10 dimensions in dimensionsMap', () => {
test('throws error when there are more than 30 dimensions in dimensionsMap', () => {
expect(() => {
new Metric({
namespace: 'Test',
Expand All @@ -154,9 +174,29 @@ describe('Metrics', () => {
dimensionI: 'value9',
dimensionJ: 'value10',
dimensionK: 'value11',
dimensionL: 'value12',
dimensionM: 'value13',
dimensionN: 'value14',
dimensionO: 'value15',
dimensionP: 'value16',
dimensionQ: 'value17',
dimensionR: 'value18',
dimensionS: 'value19',
dimensionT: 'value20',
dimensionU: 'value21',
dimensionV: 'value22',
dimensionW: 'value23',
dimensionX: 'value24',
dimensionY: 'value25',
dimensionZ: 'value26',
dimensionAA: 'value27',
dimensionAB: 'value28',
dimensionAC: 'value29',
dimensionAD: 'value30',
dimensionAE: 'value31',
},
} );
}).toThrow(/The maximum number of dimensions is 10, received 11/);
}).toThrow(/The maximum number of dimensions is 30, received 31/);

});

Expand Down

0 comments on commit 29d4f37

Please sign in to comment.