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

Enable per-thread instances for histogram stress test #2659

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

martintmk
Copy link
Contributor

Contributes to #1386

Changes

This PR enables the secondary mode for the metrics_histogram stress test where each thread gets it's own instance of meter provider:

Shared

Number of threads: 32
Throughput: 7,980,759 iterations/sec
Throughput: 7,766,680 iterations/sec
Throughput: 7,592,290 iterations/sec
Throughput: 7,229,872 iterations/sec

Per-thread

Number of threads: 32
Throughput: 92,490,062 iterations/sec
Throughput: 90,558,222 iterations/sec
Throughput: 91,087,973 iterations/sec
Throughput: 89,307,343 iterations/sec

To run the per-thread scenario run the following command:

cargo run --release --bin metrics_histogram -- 32 --per-thread

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.1%. Comparing base (0592075) to head (9a6f84c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2659   +/-   ##
=====================================
  Coverage   79.1%   79.1%           
=====================================
  Files        120     120           
  Lines      22556   22556           
=====================================
  Hits       17857   17857           
  Misses      4699    4699           

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

@@ -37,13 +37,30 @@ lazy_static! {
thread_local! {
/// Store random number generator for each thread
static CURRENT_RNG: RefCell<rngs::SmallRng> = RefCell::new(rngs::SmallRng::from_entropy());

static PROVIDER_PER_THREAD: SdkMeterProvider = SdkMeterProvider::builder()
.with_reader(ManualReader::builder().build())
Copy link
Member

Choose a reason for hiding this comment

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

will need to try one with PeriodicReader and see how it impacts resources, given its going to spawn new thread for each instance.

@cijothomas cijothomas merged commit e68fe94 into open-telemetry:main Feb 13, 2025
21 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.

2 participants