RateLimitingSampler(int tracesPerSecond) { this.maxFunction = tracesPerSecond < 10 ? new LessThan10(tracesPerSecond) : new AtLeast10(tracesPerSecond); long now = System.nanoTime(); this.nextReset = new AtomicLong(now + NANOS_PER_SECOND); }
RateLimitingSampler(int tracesPerSecond) { this.maxFunction = tracesPerSecond < 10 ? new LessThan10(tracesPerSecond) : new AtLeast10(tracesPerSecond); long now = System.nanoTime(); this.nextReset = new AtomicLong(now + NANOS_PER_SECOND); }