-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[CASSANDRA-20250][trunk] Optimize Counter, Meter and Histogram metrics using thread local counters #3927
base: trunk
Are you sure you want to change the base?
Conversation
CASSANDRA-20250
…sibility add a basic JMH test make ThreadLocalMetricsTest parametrized
add JMH for Meter implementations switch to approximate clock to reduce time retrieval overhead
…onentialMovingAverages, use single uncounted value for all 3 rates
move tickIfNessesary out from Meter.mark logic to a periodic background task remove LazySetArrayThreadLocalMetrics implementation, rename PiggybackArrayThreadLocalMetrics to ThreadLocalMetrics
use atomic long for hints in-procress counter which is frequently read introduce common Destroyable interface for metrics move cleanDeadAndUpdateSummaries invocations to a background thread and metric creation/destoying logic
…lity move ThreadLocalExponentialMovingAverages logic to ThreadLocalMeter itself
…ments, so we have to keep tick values per instance Fix condition in allocateRateGroupOffset Add dynamic Meter creation/destroying emulation
…jects associated with dead threads use BitSet for free metric id set Patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-20251
…ed to metrics and threads lifecycles Patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-20251
Patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-20251
Patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-20251
Patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-20251
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.
Wouldn’t using longadder instead of atomic longs do the same thing without having to create a layer over everything?
unfortunately no, it is already LongAdder used in Dropwizard but it is not for free from CPU usage for our amount of metrics + it has a high memory overhead: CASSANDRA-20250 - here there is a long conversation with Benedict about it and different perf test results. |
A similar idea is also described by Nitsan: https://psy-lob-saw.blogspot.com/2013/06/java-concurrent-counters-by-numbers.html (as ThreadLocalCounter option) |
… backward compatibility for Dropwizard MetricRegistryListener and Reporter functionality. Patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-20250
Patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-20250
Fix concurrency issues in writing from multiple threads to ThreadLocalMeter.rates Patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-20250
…ent class field separately Patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-20250
Optimize Counter, Meter and Histogram metrics using thread local counters
Patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-20250