Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/753#discussion_r40910516
--- Diff: storm-core/src/jvm/backtype/storm/utils/RateTracker.java ---
@@ -72,7 +80,7 @@ public RateTracker(int validTimeWindowInMils, int
numOfSlides, boolean simulate
* @param count number of arrivals
*/
public void notify(long count) {
- _histograms[_histograms.length-1]+=count;
+ _histograms[_numOfSlides - 1] += count;
--- End diff --
I was planning on doing it today, because I had already pulled it into my
distribution, and it should not be that hard to do. It is mostly switching the
_histograms to be an array of AtomicLong instead of regular long, and then
making sure that the current bucket is modified using getAndSet so that there
is no read modify write that is not atomic. I was also thinking I would do
something so that the current bucket does not require any offset calculations,
but that is a very small optimization, that once the JIT kicks in probably
would not make any difference.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---