APISonar


com.linkedin.util.clock.Time.minutes

> com > linkedin > util > clock > Time > minutes
com APIs linkedin APIs util APIs clock APIs Time APIs minutes APIs

Example 1
@org.testng.annotations.Test public void testStandardDeviationWithSmallVarianceAndLargeSample()
  {
    long interval = 7200000;
    _callTracker = new CallTrackerImpl(interval, _clock);

    List<CallCompletion> dones = startCall(_callTracker, 50 * 1000);
    _clock.addDuration(Time.minutes(60));
    endCall(dones, 25 * 1000);
    _clock.addDuration(Time.milliseconds(2));
    endCall(dones, 25 * 1000);

    _clock.setCurrentTimeMillis(_callTracker.getLastResetTime() + interval);
    Assert.assertEquals(1.0, _callTracker.getCallStats().getCallTimeStats().getStandardDeviation(),
                        0.001, "Interval Standard deviation is incorrect");
  }