Examples of RateAggregate


Examples of com.jitlogic.zorka.core.perfmon.RateAggregate

  }


  @Test
  public void testQueryEmptyWindow() throws Exception {
    RateAggregate wnd = new RateAggregate(100, -1);
    assertEquals(-1.0, wnd.rate(), 0.0001);
  }
View Full Code Here

Examples of com.jitlogic.zorka.core.perfmon.RateAggregate

  }
 
 
  @Test
  public void testSlidingWindowWithSingleItem() throws Exception {
    RateAggregate wnd = new RateAggregate(100, -1);
    wnd.feed(100, 1);
    assertEquals(0.0, wnd.rate(), 0.0001);
  }
View Full Code Here

Examples of com.jitlogic.zorka.core.perfmon.RateAggregate

  }
 
 
  @Test
  public void testSlidingWindowWithTwoItems() throws Exception {
    RateAggregate wnd = new RateAggregate(100, -1);
    wnd.feed(100, 1);
    wnd.feed(150, 1);
    assertEquals(50.0, wnd.rate(), 0.0001);
  }
View Full Code Here

Examples of com.jitlogic.zorka.core.perfmon.RateAggregate

  }

 
  @Test
  public void testWindowNotYetSlide() throws Exception {
    RateAggregate wnd = new RateAggregate(100, -1);
    testUtil.mockCurrentTimeMillis(0, 0, 50, 50, 100, 100, 100);
    wnd.feed(100);
    wnd.feed(150);
    wnd.feed(200);
    assertEquals(100.0, wnd.rate(), 0.0001);
  }
View Full Code Here

Examples of com.jitlogic.zorka.core.perfmon.RateAggregate

    assertEquals(100.0, wnd.rate(), 0.0001);
  }

  @Test
  public void testWindowSlide() throws Exception {
    RateAggregate wnd = new RateAggregate(100, -1);
    testUtil.mockCurrentTimeMillis(0, 0, 50, 50, 100, 100, 150);
    wnd.feed(100);
    wnd.feed(150);
    wnd.feed(200);
    assertEquals(50.0, wnd.rate(), 0.0001);
  }
View Full Code Here

Examples of com.jitlogic.zorka.core.perfmon.RateAggregate

    assertEquals(50.0, wnd.rate(), 0.0001);
  }
 
  @Test
  public void testWindowSlideOutOfHorizon() throws Exception {
    RateAggregate wnd = new RateAggregate(100, -1);
    testUtil.mockCurrentTimeMillis(0, 0, 50, 50, 100, 100, 1500);
    wnd.feed(100);
    wnd.feed(150);
    wnd.feed(200);
    assertEquals(-1.0, wnd.rate(), 0.0001);   
  }
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.