Package com.codahale.metrics

Examples of com.codahale.metrics.MergeableExponentiallyDecayingReservoir.update()


    res.update(7.0);
    res.update(7.0);
    res.update(7.0);
    res.update(7.0);
    res.update(7.0);
    res.update(7.0);
    res.update(7.0);

    double[] dataValues = res.getUnsortedValues();
    assertEquals("expected non-empty dataValues array", 10, dataValues.length);
    double result = StatUtils.percentile(dataValues, 50.0);
View Full Code Here


    res.update(7.0);
    res.update(7.0);
    res.update(7.0);
    res.update(7.0);
    res.update(7.0);
    res.update(7.0);

    double[] dataValues = res.getUnsortedValues();
    assertEquals("expected non-empty dataValues array", 10, dataValues.length);
    double result = StatUtils.percentile(dataValues, 50.0);
    assertEquals("expected 50th percentile to equal (constant) value of data points", 7.0, result);
View Full Code Here

  @Test
  public void testReservoirWithSingleDatum()
  {
    MergeableExponentiallyDecayingReservoir res = new MergeableExponentiallyDecayingReservoir(10, 0.015);

    res.update(3.0);

    double[] dataValues = res.getUnsortedValues();
    assertEquals("expected non-empty dataValues array", 1, dataValues.length);
    double result = StatUtils.percentile(dataValues, 50.0);
    assertEquals("expected 50th percentile to equal value of single data point", 3.0, result);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.