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

ExpAvgMeasurement doesn't properly handle add after update during warmup #212

Open
jhalterman opened this issue Sep 23, 2024 · 0 comments
Open

Comments

@jhalterman
Copy link

I noticed that ExpAvgMeasurement doesn't properly handle an add after an update when still in warmup mode. Here's a failing test:

  @Test
  public void testUpdateThenAdd() {
    ExpAvgMeasurement avg = new ExpAvgMeasurement(100, 10);
    avg.update(i -> 50);
    avg.add(100);

    Assert.assertEquals(67, avg.get().doubleValue(), 0.1);
  }

It might make sense to consider the warmup phase done once any update happens.

@jhalterman jhalterman changed the title ExpAvgMeasurement add after update during warmup ExpAvgMeasurement doesn't properly handle add after update during warmup Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant