APISonar


org.infinispan.commons.time.ControlledTimeService.time

> org > infinispan > commons > time > ControlledTimeService > time
org APIs infinispan APIs commons APIs time APIs ControlledTimeService APIs time APIs

Example 1
public void testAverageRemoteReadTime() {

      ControlledTimeService timeService = new ControlledTimeService();
      ClientStatistics clientStatistics = new ClientStatistics(true, timeService);
      // given: a get operation
      long now = timeService.time();
      // when: network is slow
      timeService.advance(1200);
      clientStatistics.dataRead(true, now, 1);
      // then:
      assertTrue(clientStatistics.getAverageRemoteReadTime() > 0);
   }