Skip to content
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

Improve multi-threaded test for Counter #1858

Merged

Conversation

utpilla
Copy link
Contributor

@utpilla utpilla commented Jun 4, 2024

Follow-up to #1845

Changes

  • Update Counter multi-threaded test to call Collect during updates
  • This offers better coverage for multi-threaded scenarios

@utpilla utpilla requested a review from a team June 4, 2024 00:43
@utpilla utpilla changed the title Update counter multithreaded tests Improve multi-threaded test for Counter Jun 4, 2024
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 94.80519% with 4 lines in your changes missing coverage. Please review.

Project coverage is 74.5%. Comparing base (f488006) to head (7ec23e1).

Current head 7ec23e1 differs from pull request most recent head 77c1a29

Please upload reports for the commit 77c1a29 to get more accurate results.

Files Patch % Lines
opentelemetry-sdk/src/metrics/mod.rs 94.8% 4 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1858   +/-   ##
=====================================
  Coverage   74.5%   74.5%           
=====================================
  Files        122     122           
  Lines      19809   19859   +50     
=====================================
+ Hits       14760   14808   +48     
- Misses      5049    5051    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

for i in 0..10 {
thread::scope(|s| {
s.spawn(|| {
counter.add(1, &[KeyValue::new("key1", "value1")]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add 1-3 diff. timeseries
add 1 with 0 attributes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and a separate test for overflow part.


for thread in update_threads {
thread.join().unwrap();
for i in 0..10 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe use 2x number of cores in the machine?

@cijothomas cijothomas merged commit f1cdaca into open-telemetry:main Jun 4, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants