forked from awslabs/aws-embedded-metrics-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent putDimensions from storing duplicate dimensions (awslabs#88
) * fix: prevent putDimensions from storing duplicate dimensions This is the Java-equivalent bug-fix for prior issue in Node: awslabs/aws-embedded-metrics-node#20 New conditions check for any matching dimension set before skipping put dimensions. This prevents duplicates from being stored. [TESTING] Unit test updated to address edge case; multiple dimension sets of variable size are added and checked. Ran integration tests using Docker and compared results in CloudWatch. * fix: change putDimensions to update/sort existing dimension sets when duplicate This change ensures new dimension key-values are used for the EMF root node by removing duplicate dimension sets and adding input dimension set to the end of the collection. Example: ``` [ { "keyA": "value1" }, { "keyA": "value2" }, ] // expected target member: { "keyA": "value2" } ``` [TESTING] Updated unit tests to check for this case wherein putDimensions may be triggered using various dimension set lengths, values, and order. * Update src/test/java/software/amazon/cloudwatchlogs/emf/model/MetricDirectiveTest.java * Update src/test/java/software/amazon/cloudwatchlogs/emf/model/MetricDirectiveTest.java Co-authored-by: Aaron Michael Lamb <aarolamb@amazon.com> Co-authored-by: Mark Kuhn <kuhn.mark@outlook.com>
- Loading branch information
1 parent
4c242fc
commit 68ab8f5
Showing
2 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters