Use separate exporter per worker for better throughput #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Adding a feature: Allow writing more metrics using "telemetrygen"
When running
telemetrygen
with multiple worker theexporter
gets used by all workers. This results in limited throughput. On my machine that means about 250 metrics per worker.With this code change each worker gets its own exporter. This allows scaling metrics throughput almost linear with the number of workers.
How to reproduce
Step 1: Install latest version of telemetrygen
Step 2: Create metrics using 1 worker:
Output
Step 3: Create metrics using 10 worker:
Output
Total number of metrics is the same, no matter how many workers we use.
Test results with code change
With this code change each worker can export about 1200-1300 metrics per second.