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

Fixed the EWMA to work regardless of the TICK_THREAD interval settings in #6

Closed
wants to merge 1 commit into from

Commits on Apr 12, 2011

  1. Fixed the EWMA to work regardless of the TICK_THREAD interval setting…

    …s in e.g. MeterMetric.
    
    Before this fix, an EWMA was always created with a default interval of 5 seconds which gave incorrect
    results when createing a MeterMetric with different values (for interval and intervalUnit).
    
    The following simple test now gives (aproximaapproximately) the same output:
    
    MeterMetric meter = MeterMetric.newMeter(1, TimeUnit.SECONDS, "test event", TimeUnit.SECONDS);
    
    for (int i = 0; i < 100; i++)
    {
    	Thread.sleep(100);
    	meter.mark();
    }
    
    System.out.println(meter.meanRate());
    System.out.println(meter.oneMinuteRate());
    Jesper Blomquist authored and Jesper Blomquist committed Apr 12, 2011
    Configuration menu
    Copy the full SHA
    143f28b View commit details
    Browse the repository at this point in the history