forked from open-telemetry/opentelemetry-collector-contrib
-
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.
[pkg/pmetrictest] option to ignore float precision discrepancies when…
… using `CompareMetrics` (open-telemetry#35085) **Description:** <Describe what has changed.> Addresses issue: open-telemetry#35060 Adds option to `CompareMetrics` testing function that rounds floats to an arbitrary number of decimals. This is needed to avoid issues with float precision during testing. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#35060 **Testing:** <Describe what testing was performed and which tests were added.> Test and test data added for this CompareMetrics option **Documentation:** No new docs. Let me know if I should be adding something somewhere! Co-authored-by: Antoine Toulme <[email protected]>
- Loading branch information
1 parent
78318b8
commit 290063a
Showing
4 changed files
with
76 additions
and
0 deletions.
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
9 changes: 9 additions & 0 deletions
9
pkg/pdatatest/pmetrictest/testdata/ignore-data-point-value-double-precision/actual.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resourceMetrics: | ||
- resource: {} | ||
scopeMetrics: | ||
- metrics: | ||
- gauge: | ||
dataPoints: | ||
- asDouble: 654.321 | ||
name: gauge.one | ||
scope: {} |
9 changes: 9 additions & 0 deletions
9
pkg/pdatatest/pmetrictest/testdata/ignore-data-point-value-double-precision/expected.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resourceMetrics: | ||
- resource: {} | ||
scopeMetrics: | ||
- metrics: | ||
- gauge: | ||
dataPoints: | ||
- asDouble: 654.32111 | ||
name: gauge.one | ||
scope: {} |