/external/guava/android/guava-tests/test/com/google/common/base/ |
D | StopwatchTest.java | 36 private final Stopwatch stopwatch = new Stopwatch(ticker); field in StopwatchTest 50 assertFalse(stopwatch.isRunning()); in testInitialState() 51 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testInitialState() 55 assertSame(stopwatch, stopwatch.start()); in testStart() 56 assertTrue(stopwatch.isRunning()); in testStart() 60 stopwatch.start(); in testStart_whileRunning() 62 stopwatch.start(); in testStart_whileRunning() 66 assertTrue(stopwatch.isRunning()); in testStart_whileRunning() 70 stopwatch.start(); in testStop() 71 assertSame(stopwatch, stopwatch.stop()); in testStop() [all …]
|
/external/guava/guava-tests/test/com/google/common/base/ |
D | StopwatchTest.java | 38 private final Stopwatch stopwatch = new Stopwatch(ticker); field in StopwatchTest 52 assertFalse(stopwatch.isRunning()); in testInitialState() 53 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testInitialState() 57 assertSame(stopwatch, stopwatch.start()); in testStart() 58 assertTrue(stopwatch.isRunning()); in testStart() 62 stopwatch.start(); in testStart_whileRunning() 64 stopwatch.start(); in testStart_whileRunning() 68 assertTrue(stopwatch.isRunning()); in testStart_whileRunning() 72 stopwatch.start(); in testStop() 73 assertSame(stopwatch, stopwatch.stop()); in testStop() [all …]
|
/external/guava/android/guava-tests/test/com/google/common/util/concurrent/ |
D | RateLimiterTest.java | 49 private final FakeStopwatch stopwatch = new FakeStopwatch(); field in RateLimiterTest 52 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimple() 66 RateLimiter r = RateLimiter.create(Double.MIN_VALUE, stopwatch); in testDoubleMinValueCanAcquireExactlyOnce() 69 stopwatch.sleepMillis(Integer.MAX_VALUE); in testDoubleMinValueCanAcquireExactlyOnce() 126 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleWithWait() 128 stopwatch.sleepMillis(200); // U0.20, we are ready for the next request... in testSimpleWithWait() 135 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleAcquireReturnValues() 137 stopwatch.sleepMillis(200); // U0.20, we are ready for the next request... in testSimpleAcquireReturnValues() 144 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleAcquireEarliestAvailableIsInPast() 146 stopwatch.sleepMillis(400); in testSimpleAcquireEarliestAvailableIsInPast() [all …]
|
D | SimpleTimeLimiterTest.java | 98 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_goodMethodWithEnoughTime() local 103 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testNewProxy_goodMethodWithEnoughTime() 110 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_goodMethodWithNotEnoughTime() local 118 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(NOT_ENOUGH_MS, DELAY_MS * 2)); in testNewProxy_goodMethodWithNotEnoughTime() 128 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_badMethodWithEnoughTime() local 136 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testNewProxy_badMethodWithEnoughTime() 142 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_badMethodWithNotEnoughTime() local 150 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(NOT_ENOUGH_MS, DELAY_MS * 2)); in testNewProxy_badMethodWithNotEnoughTime() 154 Stopwatch stopwatch = Stopwatch.createStarted(); in testCallWithTimeout_goodCallableWithEnoughTime() local 159 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testCallWithTimeout_goodCallableWithEnoughTime() [all …]
|
D | UninterruptiblesTest.java | 99 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitTimeoutExceeded() local 105 assertAtLeastTimePassed(stopwatch, 500); in testConditionAwaitTimeoutExceeded() 110 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitTimeoutNotExceeded() local 116 assertTimeNotPassed(stopwatch, LONG_DELAY_MS); in testConditionAwaitTimeoutNotExceeded() 121 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitInterruptedTimeoutExceeded() local 128 assertAtLeastTimePassed(stopwatch, 1000); in testConditionAwaitInterruptedTimeoutExceeded() 133 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitInterruptedTimeoutNotExceeded() local 140 assertTimeNotPassed(stopwatch, LONG_DELAY_MS); in testConditionAwaitInterruptedTimeoutNotExceeded() 146 Stopwatch stopwatch = Stopwatch.createStarted(); in testPutWithNoWait() local 149 assertTimeNotPassed(stopwatch, LONG_DELAY_MS); in testPutWithNoWait() [all …]
|
/external/guava/guava-tests/test/com/google/common/util/concurrent/ |
D | RateLimiterTest.java | 49 private final FakeStopwatch stopwatch = new FakeStopwatch(); field in RateLimiterTest 52 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimple() 66 RateLimiter r = RateLimiter.create(Double.MIN_VALUE, stopwatch); in testDoubleMinValueCanAcquireExactlyOnce() 69 stopwatch.sleepMillis(Integer.MAX_VALUE); in testDoubleMinValueCanAcquireExactlyOnce() 126 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleWithWait() 128 stopwatch.sleepMillis(200); // U0.20, we are ready for the next request... in testSimpleWithWait() 135 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleAcquireReturnValues() 137 stopwatch.sleepMillis(200); // U0.20, we are ready for the next request... in testSimpleAcquireReturnValues() 144 RateLimiter limiter = RateLimiter.create(5.0, stopwatch); in testSimpleAcquireEarliestAvailableIsInPast() 146 stopwatch.sleepMillis(400); in testSimpleAcquireEarliestAvailableIsInPast() [all …]
|
D | SimpleTimeLimiterTest.java | 98 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_goodMethodWithEnoughTime() local 103 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testNewProxy_goodMethodWithEnoughTime() 110 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_goodMethodWithNotEnoughTime() local 118 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(NOT_ENOUGH_MS, DELAY_MS * 2)); in testNewProxy_goodMethodWithNotEnoughTime() 128 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_badMethodWithEnoughTime() local 136 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testNewProxy_badMethodWithEnoughTime() 142 Stopwatch stopwatch = Stopwatch.createStarted(); in testNewProxy_badMethodWithNotEnoughTime() local 150 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(NOT_ENOUGH_MS, DELAY_MS * 2)); in testNewProxy_badMethodWithNotEnoughTime() 154 Stopwatch stopwatch = Stopwatch.createStarted(); in testCallWithTimeout_goodCallableWithEnoughTime() local 159 assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS)); in testCallWithTimeout_goodCallableWithEnoughTime() [all …]
|
D | UninterruptiblesTest.java | 99 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitTimeoutExceeded() local 105 assertAtLeastTimePassed(stopwatch, 500); in testConditionAwaitTimeoutExceeded() 110 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitTimeoutNotExceeded() local 116 assertTimeNotPassed(stopwatch, LONG_DELAY_MS); in testConditionAwaitTimeoutNotExceeded() 121 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitInterruptedTimeoutExceeded() local 128 assertAtLeastTimePassed(stopwatch, 1000); in testConditionAwaitInterruptedTimeoutExceeded() 133 Stopwatch stopwatch = Stopwatch.createStarted(); in testConditionAwaitInterruptedTimeoutNotExceeded() local 140 assertTimeNotPassed(stopwatch, LONG_DELAY_MS); in testConditionAwaitInterruptedTimeoutNotExceeded() 146 Stopwatch stopwatch = Stopwatch.createStarted(); in testPutWithNoWait() local 149 assertTimeNotPassed(stopwatch, LONG_DELAY_MS); in testPutWithNoWait() [all …]
|
/external/guava/android/guava/src/com/google/common/util/concurrent/ |
D | RateLimiter.java | 132 static RateLimiter create(double permitsPerSecond, SleepingStopwatch stopwatch) { in create() argument 133 RateLimiter rateLimiter = new SmoothBursty(stopwatch, 1.0 /* maxBurstSeconds */); in create() 174 SleepingStopwatch stopwatch) { in create() argument 175 RateLimiter rateLimiter = new SmoothWarmingUp(stopwatch, warmupPeriod, unit, coldFactor); in create() 184 private final SleepingStopwatch stopwatch; field in RateLimiter 202 RateLimiter(SleepingStopwatch stopwatch) { in RateLimiter() argument 203 this.stopwatch = checkNotNull(stopwatch); in RateLimiter() 228 doSetRate(permitsPerSecond, stopwatch.readMicros()); in setRate() 274 stopwatch.sleepMicrosUninterruptibly(microsToWait); in acquire() 287 return reserveAndGetWaitLength(permits, stopwatch.readMicros()); in reserve() [all …]
|
D | SmoothRateLimiter.java | 216 SleepingStopwatch stopwatch, long warmupPeriod, TimeUnit timeUnit, double coldFactor) { in SmoothWarmingUp() argument 217 super(stopwatch); in SmoothWarmingUp() 280 SmoothBursty(SleepingStopwatch stopwatch, double maxBurstSeconds) { in SmoothBursty() argument 281 super(stopwatch); in SmoothBursty() 329 private SmoothRateLimiter(SleepingStopwatch stopwatch) { in SmoothRateLimiter() argument 330 super(stopwatch); in SmoothRateLimiter()
|
/external/guava/guava/src/com/google/common/util/concurrent/ |
D | RateLimiter.java | 132 static RateLimiter create(double permitsPerSecond, SleepingStopwatch stopwatch) { in create() argument 133 RateLimiter rateLimiter = new SmoothBursty(stopwatch, 1.0 /* maxBurstSeconds */); in create() 174 SleepingStopwatch stopwatch) { in create() argument 175 RateLimiter rateLimiter = new SmoothWarmingUp(stopwatch, warmupPeriod, unit, coldFactor); in create() 184 private final SleepingStopwatch stopwatch; field in RateLimiter 202 RateLimiter(SleepingStopwatch stopwatch) { in RateLimiter() argument 203 this.stopwatch = checkNotNull(stopwatch); in RateLimiter() 228 doSetRate(permitsPerSecond, stopwatch.readMicros()); in setRate() 274 stopwatch.sleepMicrosUninterruptibly(microsToWait); in acquire() 287 return reserveAndGetWaitLength(permits, stopwatch.readMicros()); in reserve() [all …]
|
D | SmoothRateLimiter.java | 216 SleepingStopwatch stopwatch, long warmupPeriod, TimeUnit timeUnit, double coldFactor) { in SmoothWarmingUp() argument 217 super(stopwatch); in SmoothWarmingUp() 280 SmoothBursty(SleepingStopwatch stopwatch, double maxBurstSeconds) { in SmoothBursty() argument 281 super(stopwatch); in SmoothBursty() 329 private SmoothRateLimiter(SleepingStopwatch stopwatch) { in SmoothRateLimiter() argument 330 super(stopwatch); in SmoothRateLimiter()
|
/external/dagger2/java/dagger/producers/monitoring/ |
D | TimingProducerMonitor.java | 30 private final Stopwatch stopwatch; field in TimingProducerMonitor 37 this.stopwatch = Stopwatch.createUnstarted(ticker); in TimingProducerMonitor() 44 stopwatch.start(); in methodStarting() 51 long durationNanos = stopwatch.elapsed(NANOSECONDS); in methodFinished() 57 long latencyNanos = stopwatch.elapsed(NANOSECONDS); in succeeded() 63 if (stopwatch.isRunning()) { in failed() 64 long latencyNanos = stopwatch.elapsed(NANOSECONDS); in failed()
|
D | TimingProductionComponentMonitor.java | 35 private final Stopwatch stopwatch; field in TimingProductionComponentMonitor 40 this.stopwatch = Stopwatch.createStarted(ticker); in TimingProductionComponentMonitor() 45 return new TimingProducerMonitor(recorder.producerTimingRecorderFor(token), ticker, stopwatch); in producerMonitorFor()
|
/external/grpc-grpc/src/csharp/Grpc.IntegrationTesting/ |
D | ClientRunners.cs | 211 var stopwatch = new Stopwatch(); in RunUnary() 222 stopwatch.Restart(); in RunUnary() 224 stopwatch.Stop(); in RunUnary() 227 … threadLocalHistogram.Value.AddObservation(stopwatch.Elapsed.TotalSeconds * SecondsToNanos); in RunUnary() 237 var stopwatch = new Stopwatch(); in RunUnaryAsync() 241 stopwatch.Restart(); in RunUnaryAsync() 243 stopwatch.Stop(); in RunUnaryAsync() 246 … threadLocalHistogram.Value.AddObservation(stopwatch.Elapsed.TotalSeconds * SecondsToNanos); in RunUnaryAsync() 256 var stopwatch = new Stopwatch(); in RunStreamingPingPongAsync() 262 stopwatch.Restart(); in RunStreamingPingPongAsync() [all …]
|
/external/guice/core/src/com/google/inject/internal/ |
D | InternalInjectorCreator.java | 60 private final Stopwatch stopwatch = new Stopwatch(); field in InternalInjectorCreator 103 shells = shellBuilder.build(initializer, bindingData, stopwatch, errors); in build() 104 stopwatch.resetAndLog("Injector construction"); in build() 123 stopwatch.resetAndLog("Binding initialization"); in initializeStatically() 128 stopwatch.resetAndLog("Binding indexing"); in initializeStatically() 131 stopwatch.resetAndLog("Collecting injection requests"); in initializeStatically() 134 stopwatch.resetAndLog("Binding validation"); in initializeStatically() 137 stopwatch.resetAndLog("Static validation"); in initializeStatically() 140 stopwatch.resetAndLog("Instance member validation"); in initializeStatically() 146 stopwatch.resetAndLog("Provider verification"); in initializeStatically() [all …]
|
D | InjectorShell.java | 125 Stopwatch stopwatch, in build() argument 154 stopwatch.resetAndLog("Module execution"); in build() 160 stopwatch.resetAndLog("Interceptors creation"); in build() 170 stopwatch.resetAndLog("TypeListeners & ProvisionListener creation"); in build() 173 stopwatch.resetAndLog("Scopes creation"); in build() 176 stopwatch.resetAndLog("Converters creation"); in build() 187 stopwatch.resetAndLog("Binding creation"); in build() 190 stopwatch.resetAndLog("Module annotated method scanners creation"); in build() 199 injectorShells.addAll(builder.build(initializer, bindingData, stopwatch, errors)); in build() 201 stopwatch.resetAndLog("Private environment creation"); in build()
|
/external/dagger2/java/dagger/internal/codegen/ |
D | DaggerStatisticsCollector.java | 60 Stopwatch stopwatch = in stepStarted() local 62 stopwatch.start(); in stepStarted() 67 Stopwatch stopwatch = stepStopwatches.get(step); in stepFinished() local 68 roundBuilder.addStepDuration(step, elapsedTime(stopwatch)); in stepFinished() 69 stopwatch.reset(); in stepFinished() 89 private Duration elapsedTime(Stopwatch stopwatch) { in elapsedTime() argument 92 return Duration.ofNanos(stopwatch.elapsed(NANOSECONDS)); in elapsedTime()
|
/external/grpc-grpc/src/csharp/Grpc.Core/Utils/ |
D | BenchmarkUtil.cs | 46 var stopwatch = new Stopwatch(); in RunBenchmark() 47 stopwatch.Start(); in RunBenchmark() 52 stopwatch.Stop(); in RunBenchmark() 53 logger.Info("Elapsed time: {0}ms", stopwatch.ElapsedMilliseconds); in RunBenchmark() 54 …Info("Ops per second: {0}", (int)((double)benchmarkIterations * 1000 / stopwatch.ElapsedMilliseco… in RunBenchmark()
|
/external/grpc-grpc-java/core/src/main/java/io/grpc/internal/ |
D | Rescheduler.java | 37 private final Stopwatch stopwatch; field in Rescheduler 46 Stopwatch stopwatch) { in Rescheduler() argument 50 this.stopwatch = stopwatch; in Rescheduler() 51 stopwatch.start(); in Rescheduler() 114 return stopwatch.elapsed(TimeUnit.NANOSECONDS); in nanoTime()
|
D | Http2Ping.java | 48 private final Stopwatch stopwatch; field in Http2Ping 81 public Http2Ping(long data, Stopwatch stopwatch) { in Http2Ping() argument 83 this.stopwatch = stopwatch; in Http2Ping() 131 roundTripTimeNanos = this.roundTripTimeNanos = stopwatch.elapsed(TimeUnit.NANOSECONDS); in complete()
|
/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/ |
D | FakeClockTest.java | 102 Stopwatch stopwatch = fakeClock.getStopwatchSupplier().get(); in testStopWatch() local 105 stopwatch.start(); in testStopWatch() 109 assertEquals(expectedElapsedNanos, stopwatch.elapsed(TimeUnit.NANOSECONDS)); in testStopWatch() 113 assertEquals(expectedElapsedNanos, stopwatch.elapsed(TimeUnit.NANOSECONDS)); in testStopWatch() 115 stopwatch.stop(); in testStopWatch() 118 assertEquals(expectedElapsedNanos, stopwatch.elapsed(TimeUnit.NANOSECONDS)); in testStopWatch() 120 stopwatch.reset(); in testStopWatch() 123 assertEquals(expectedElapsedNanos, stopwatch.elapsed(TimeUnit.NANOSECONDS)); in testStopWatch()
|
/external/caliper/caliper/src/main/java/com/google/caliper/worker/ |
D | MacrobenchmarkWorker.java | 42 private final Stopwatch stopwatch; field in MacrobenchmarkWorker 50 this.stopwatch = Stopwatch.createUnstarted(ticker); in MacrobenchmarkWorker() 68 stopwatch.start(); in measure() 70 long nanos = stopwatch.stop().elapsed(NANOSECONDS); in measure() 71 stopwatch.reset(); in measure()
|
/external/grpc-grpc/src/csharp/Grpc.Microbenchmarks/ |
D | PInvokeByteArrayBenchmark.cs | 52 var stopwatch = Stopwatch.StartNew(); in ThreadBody() 60 stopwatch.Stop(); in ThreadBody() 61 Console.WriteLine("Elapsed millis: " + stopwatch.ElapsedMilliseconds); in ThreadBody()
|
/external/grpc-grpc/examples/csharp/RouteGuide/RouteGuideServer/ |
D | RouteGuideImpl.cs | 73 var stopwatch = new Stopwatch(); in RecordRoute() 74 stopwatch.Start(); in RecordRoute() 91 stopwatch.Stop(); in RecordRoute() 98 ElapsedTime = (int)(stopwatch.ElapsedMilliseconds / 1000) in RecordRoute()
|