@Test @UseDataProvider("provideRequestsPerSecond") public void requestsPerSecond(final double rate, final TimeUnit unit, final double expectedRequestsPerSecond) { final RequestRateScheduler s = new RequestRateScheduler(1.0, TimeUnit.SECONDS, 0.0, TimeUnit.SECONDS); assertThat(s.requestsPerSecond(rate, unit), closeTo(expectedRequestsPerSecond, Math.pow(0.1, 6))); }
double requestsPerSecond(final double rate, final TimeUnit unit) { return rate / (unit.toNanos(1) / (double) TimeUnit.SECONDS.toNanos(1)); }
RequestRateScheduler implements Scheduler { double requestsPerSecond(final double rate, final TimeUnit unit) { return rate / (unit.toNanos(1) / (double) TimeUnit.SECONDS.toNanos(1)); } }
RequestRateScheduler implements Scheduler { double requestsPerSecond(final double rate, final TimeUnit unit) { return rate / (unit.toNanos(1) / (double) TimeUnit.SECONDS.toNanos(1)); } RequestRateScheduler(final double rate, final TimeUnit unit, final double rampup,
      final TimeUnit rampupUnit); }
RequestRateScheduler implements Scheduler { double requestsPerSecond(final double rate, final TimeUnit unit) { return rate / (unit.toNanos(1) / (double) TimeUnit.SECONDS.toNanos(1)); } RequestRateScheduler(final double rate, final TimeUnit unit, final double rampup,
      final TimeUnit rampupUnit); @Override void schedule(); @Override void complete(); @Override String toString(); }
RequestRateScheduler implements Scheduler { double requestsPerSecond(final double rate, final TimeUnit unit) { return rate / (unit.toNanos(1) / (double) TimeUnit.SECONDS.toNanos(1)); } RequestRateScheduler(final double rate, final TimeUnit unit, final double rampup,
      final TimeUnit rampupUnit); @Override void schedule(); @Override void complete(); @Override String toString();  }