Home
last modified time | relevance | path

Searched refs:stopwatch (Results 1 – 25 of 47) sorted by relevance

12

/external/guava/guava-tests/test/com/google/common/base/
DStopwatchTest.java38 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/guava-gwt/test-super/com/google/common/base/super/com/google/common/base/
DStopwatchTest.java37 private final Stopwatch stopwatch = new Stopwatch(ticker); field in StopwatchTest
51 assertFalse(stopwatch.isRunning()); in testInitialState()
52 assertEquals(0, stopwatch.elapsed(NANOSECONDS)); in testInitialState()
56 assertSame(stopwatch, stopwatch.start()); in testStart()
57 assertTrue(stopwatch.isRunning()); in testStart()
61 stopwatch.start(); in testStart_whileRunning()
63 stopwatch.start(); in testStart_whileRunning()
67 assertTrue(stopwatch.isRunning()); in testStart_whileRunning()
71 stopwatch.start(); in testStop()
72 assertSame(stopwatch, stopwatch.stop()); in testStop()
[all …]
/external/guava/guava-tests/test/com/google/common/util/concurrent/
DRateLimiterTest.java51 private final FakeStopwatch stopwatch = new FakeStopwatch(); field in RateLimiterTest
54 RateLimiter limiter = RateLimiter.create(stopwatch, 5.0); in testSimple()
118 RateLimiter limiter = RateLimiter.create(stopwatch, 5.0); in testSimpleWithWait()
120 stopwatch.sleepMillis(200); // U0.20, we are ready for the next request... in testSimpleWithWait()
127 RateLimiter limiter = RateLimiter.create(stopwatch, 5.0); in testSimpleAcquireReturnValues()
129 stopwatch.sleepMillis(200); // U0.20, we are ready for the next request... in testSimpleAcquireReturnValues()
136 RateLimiter limiter = RateLimiter.create(stopwatch, 5.0); in testSimpleAcquireEarliestAvailableIsInPast()
138 stopwatch.sleepMillis(400); in testSimpleAcquireEarliestAvailableIsInPast()
145 RateLimiter limiter = RateLimiter.create(stopwatch, 5.0); in testOneSecondBurst()
146 stopwatch.sleepMillis(1000); // max capacity reached in testOneSecondBurst()
[all …]
/external/guava/guava/src/com/google/common/util/concurrent/
DRateLimiter.java137 static RateLimiter create(SleepingStopwatch stopwatch, double permitsPerSecond) { in create() argument
138 RateLimiter rateLimiter = new SmoothBursty(stopwatch, 1.0 /* maxBurstSeconds */); in create()
174 SleepingStopwatch stopwatch, double permitsPerSecond, long warmupPeriod, TimeUnit unit) { in create() argument
175 RateLimiter rateLimiter = new SmoothWarmingUp(stopwatch, warmupPeriod, unit); in create()
184 private final SleepingStopwatch stopwatch; field in RateLimiter
202 RateLimiter(SleepingStopwatch stopwatch) { in RateLimiter() argument
203 this.stopwatch = checkNotNull(stopwatch); in RateLimiter()
229 doSetRate(permitsPerSecond, stopwatch.readMicros()); in setRate()
274 stopwatch.sleepMicrosUninterruptibly(microsToWait); in acquire()
287 return reserveAndGetWaitLength(permits, stopwatch.readMicros()); in reserve()
[all …]
DSmoothRateLimiter.java230 SmoothWarmingUp(SleepingStopwatch stopwatch, long warmupPeriod, TimeUnit timeUnit) { in SmoothWarmingUp() argument
231 super(stopwatch); in SmoothWarmingUp()
284 SmoothBursty(SleepingStopwatch stopwatch, double maxBurstSeconds) { in SmoothBursty() argument
285 super(stopwatch); in SmoothBursty()
332 private SmoothRateLimiter(SleepingStopwatch stopwatch) { in SmoothRateLimiter() argument
333 super(stopwatch); in SmoothRateLimiter()
DServiceManager.java483 Stopwatch stopwatch = startupTimers.get(service); in tryStartTiming() local
484 if (stopwatch == null) { in tryStartTiming()
644 Stopwatch stopwatch = startupTimers.get(service); in transitionService() local
645 if (stopwatch == null) { in transitionService()
647 stopwatch = Stopwatch.createStarted(); in transitionService()
648 startupTimers.put(service, stopwatch); in transitionService()
650 if (to.compareTo(RUNNING) >= 0 && stopwatch.isRunning()) { in transitionService()
652 stopwatch.stop(); in transitionService()
654 logger.log(Level.FINE, "Started {0} in {1}.", new Object[] {service, stopwatch}); in transitionService()
/external/grpc-grpc/src/csharp/Grpc.IntegrationTesting/
DClientRunners.cs211 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 …]
DStressTestClient.cs146 var stopwatch = Stopwatch.StartNew(); in RunBodyAsync()
150 stopwatch.Stop(); in RunBodyAsync()
151 histogram.AddObservation(stopwatch.Elapsed.TotalSeconds * SecondsToNanos); in RunBodyAsync()
/external/guice/core/src/com/google/inject/internal/
DInternalInjectorCreator.java60 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 …]
DInjectorShell.java125 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/grpc-grpc/src/csharp/Grpc.Core/Utils/
DBenchmarkUtil.cs46 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/
DRescheduler.java37 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()
DHttp2Ping.java48 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()
DCensusStatsModule.java313 private final Stopwatch stopwatch; field in CensusStatsModule.ClientCallTracer
331 this.stopwatch = module.stopwatchSupplier.get().start(); in ClientCallTracer()
383 stopwatch.stop(); in callEnded()
384 long roundtripNanos = stopwatch.elapsed(TimeUnit.NANOSECONDS); in callEnded()
478 private final Stopwatch stopwatch; field in CensusStatsModule.ServerTracer
497 this.stopwatch = stopwatchSupplier.get().start(); in ServerTracer()
587 stopwatch.stop(); in streamClosed()
588 long elapsedTimeNanos = stopwatch.elapsed(TimeUnit.NANOSECONDS); in streamClosed()
DDnsNameResolver.java134 private final Stopwatch stopwatch; field in DnsNameResolver
147 Stopwatch stopwatch) { in DnsNameResolver() argument
170 this.stopwatch = Preconditions.checkNotNull(stopwatch, "stopwatch"); in DnsNameResolver()
204 && stopwatch.elapsed(TimeUnit.NANOSECONDS) > networkAddressCacheTtlNanos);
239 stopwatch.reset().start();
/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/
DFakeClockTest.java102 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/
DMacrobenchmarkWorker.java42 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/examples/csharp/RouteGuide/RouteGuideServer/
DRouteGuideImpl.cs73 var stopwatch = new Stopwatch(); in RecordRoute()
74 stopwatch.Start(); in RecordRoute()
91 stopwatch.Stop(); in RecordRoute()
98 ElapsedTime = (int)(stopwatch.ElapsedMilliseconds / 1000) in RecordRoute()
/external/grpc-grpc/src/csharp/Grpc.Microbenchmarks/
DPInvokeByteArrayBenchmark.cs52 var stopwatch = Stopwatch.StartNew(); in ThreadBody()
60 stopwatch.Stop(); in ThreadBody()
61 Console.WriteLine("Elapsed millis: " + stopwatch.ElapsedMilliseconds); in ThreadBody()
DCompletionRegistryBenchmark.cs57 var stopwatch = Stopwatch.StartNew(); in ThreadBody()
64 stopwatch.Stop(); in ThreadBody()
65 Console.WriteLine("Elapsed millis: " + stopwatch.ElapsedMilliseconds); in ThreadBody()
DSendMessageBenchmark.cs63 var stopwatch = Stopwatch.StartNew(); in ThreadBody()
70 stopwatch.Stop(); in ThreadBody()
71 Console.WriteLine("Elapsed millis: " + stopwatch.ElapsedMilliseconds); in ThreadBody()
/external/caliper/caliper/src/main/java/com/google/caliper/runner/
DConsoleOutput.java58 private final Stopwatch stopwatch; field in ConsoleOutput
61 ConsoleOutput(@Stdout PrintWriter stdout, int numberOfTrials, Stopwatch stopwatch) { in ConsoleOutput() argument
64 this.stopwatch = stopwatch; in ConsoleOutput()
145 stdout.format("Execution complete: %s.%n", stopwatch.stop()); in close()
DExperimentingCaliperRun.java152 Stopwatch stopwatch = Stopwatch.createStarted(); in run() local
157 ConsoleOutput output = new ConsoleOutput(stdout, totalTrials, stopwatch); in run()
/external/grpc-grpc-java/testing/src/main/java/io/grpc/testing/
DGrpcCleanupRule.java52 private Stopwatch stopwatch = Stopwatch.createUnstarted(); field in GrpcCleanupRule
80 this.stopwatch = Stopwatch.createUnstarted(ticker); in setTicker()
150 stopwatch.start();
166 timeoutNanos - stopwatch.elapsed(TimeUnit.NANOSECONDS), TimeUnit.NANOSECONDS);
/external/guava/guava-tests/benchmark/com/google/common/base/
DStopwatchBenchmark.java32 @Benchmark long stopwatch(int reps) { in stopwatch() method in StopwatchBenchmark

12