-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more tests to Metric SDK aggregation #1600
Add more tests to Metric SDK aggregation #1600
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1600 +/- ##
=======================================
+ Coverage 67.0% 67.3% +0.3%
=======================================
Files 138 138
Lines 19479 19654 +175
=======================================
+ Hits 13058 13243 +185
+ Misses 6421 6411 -10 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test looks good. I'd add some more details on what we are testing here.
I personally like table driven unit tests so if we can use for loop here may save us some duplication
// "multi_thread" tokio flavor must be used else flush won't | ||
// be able to make progress! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: don't think we need this for every test but not a strong opinion
let meter1 = meter_provider.meter("test.meter1"); | ||
let meter2 = meter_provider.meter("test.meter2"); | ||
let counter1 = meter1 | ||
.u64_counter("my_counter") | ||
.with_unit(Unit::new("my_unit")) | ||
.with_description("my_description") | ||
.init(); | ||
|
||
let counter2 = meter2 | ||
.u64_counter("my_counter") | ||
.with_unit(Unit::new("my_unit")) | ||
.with_description("my_description") | ||
.init(); | ||
|
||
let attribute = vec![KeyValue::new("key1", "value1")]; | ||
counter1.add(10, &attribute); | ||
counter2.add(5, &attribute); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just loop over test.meter1
and test.meter2
here?
Adding more tests to test meter and instrument identify part, and whether they get merged or not.