You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent putDimensions from storing duplicate dimensions (#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 <[email protected]>
Co-authored-by: Mark Kuhn <[email protected]>
0 commit comments