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

Reimplement histogram using mutex instead of stateLocker #669

Merged
merged 3 commits into from
Apr 29, 2020

Conversation

evantorrie
Copy link
Contributor

Histogram version of #667
Unblocks #657

Move existing implementation to histogram_statelocker.go - should be deleted before merge, but here to show performance difference.

Implement benchmarks for single thread and parallel histogram updates comparing mutex version to stateLocker version.

Move existing implementation to histogram_statelocker.go. Implement
benchmarks for single thread and parallel histogram updates comparing
mutex version to stateLocker version
@jmacd jmacd added the area:metrics Part of OpenTelemetry Metrics label Apr 28, 2020
@jmacd
Copy link
Contributor

jmacd commented Apr 28, 2020

Want to post the benchmarks here, then drop the StateLocker-based impl?

@evantorrie
Copy link
Contributor Author

Benchmarks:

pkg: go.opentelemetry.io/otel/sdk/metric/aggregator/histogram
BenchmarkHistogramAggregators
BenchmarkHistogramAggregators/mutex
BenchmarkHistogramAggregators/mutex-8        	32877236	        36.9 ns/op
BenchmarkHistogramAggregators/statelocker
BenchmarkHistogramAggregators/statelocker-8  	19097325	        59.5 ns/op
BenchmarkHistogramAggregatorsRunParallel
BenchmarkHistogramAggregatorsRunParallel/mutex
BenchmarkHistogramAggregatorsRunParallel/mutex-8         	11691177	        98.1 ns/op
BenchmarkHistogramAggregatorsRunParallel/statelocker
BenchmarkHistogramAggregatorsRunParallel/statelocker-8   	10286472	       118 ns/op

@jmacd jmacd merged commit e4ec924 into open-telemetry:master Apr 29, 2020
evantorrie added a commit to evantorrie/opentelemetry-go that referenced this pull request Apr 30, 2020
Fixes open-telemetry#657

With the changes in open-telemetry#667 and open-telemetry#669 to use a plain-old-mutex for
concurrent access of Histogram and MinMaxSumCount aggregators,
the StateLocker implementation is no longer used in the project.
jmacd added a commit that referenced this pull request Apr 30, 2020
Fixes #657

With the changes in #667 and #669 to use a plain-old-mutex for
concurrent access of Histogram and MinMaxSumCount aggregators,
the StateLocker implementation is no longer used in the project.

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
@evantorrie evantorrie deleted the histogram-mutex branch June 14, 2020 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants