List of usage examples for com.google.common.base Stopwatch createUnstarted
@CheckReturnValue public static Stopwatch createUnstarted(Ticker ticker)
From source file:dagger.internal.codegen.DaggerStatistics.java
@Inject
DaggerStatistics(Ticker ticker) {
totalRuntimeStopwatch = Stopwatch.createUnstarted(ticker);
}
From source file:dagger.producers.monitoring.TimingProducerMonitor.java
TimingProducerMonitor(ProducerTimingRecorder recorder, Ticker ticker, Stopwatch componentStopwatch) { this.recorder = recorder; this.stopwatch = Stopwatch.createUnstarted(ticker); this.componentStopwatch = componentStopwatch; }
From source file:com.google.caliper.worker.MacrobenchmarkWorker.java
@Inject MacrobenchmarkWorker(@Benchmark Object benchmark, @BenchmarkMethod Method method, Ticker ticker, @WorkerOptions Map<String, String> workerOptions) { super(benchmark, method); this.stopwatch = Stopwatch.createUnstarted(ticker); this.beforeRepMethods = getAnnotatedMethods(benchmark.getClass(), BeforeRep.class); this.afterRepMethods = getAnnotatedMethods(benchmark.getClass(), AfterRep.class); this.gcBeforeEach = Boolean.parseBoolean(workerOptions.get("gcBeforeEach")); }
From source file:dk.ilios.spanner.worker.MacrobenchmarkWorker.java
public MacrobenchmarkWorker(BenchmarkClass benchmarkClass, Method method, Ticker ticker, RuntimeInstrumentConfig options, SortedMap<String, String> userParameters) { super(benchmarkClass.getInstance(), method, userParameters); this.stopwatch = Stopwatch.createUnstarted(ticker); this.beforeRepMethods = Reflection.getAnnotatedMethods(benchmark.getClass(), BeforeRep.class); this.afterRepMethods = Reflection.getAnnotatedMethods(benchmark.getClass(), AfterRep.class); this.gcBeforeEach = options.gcBeforeEachMeasurement(); }
From source file:com.google.caliper.worker.instrument.MacrobenchmarkWorkerInstrument.java
@Inject MacrobenchmarkWorkerInstrument(@Benchmark Object benchmark, @BenchmarkMethod Method method, Ticker ticker, @WorkerInstrument.Options Map<String, String> options) { super(benchmark, method); this.stopwatch = Stopwatch.createUnstarted(ticker); this.beforeRepMethods = getAnnotatedMethods(benchmark.getClass(), BeforeRep.class); this.afterRepMethods = getAnnotatedMethods(benchmark.getClass(), AfterRep.class); this.gcBeforeEach = Boolean.parseBoolean(options.get("gcBeforeEach")); }
From source file:org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor.java
@VisibleForTesting protected TimeTrackingProcessor(Processor delegate, AnnotationProcessorResult result, Ticker ticker) { super(delegate); this.result = result; this.stopwatch = Stopwatch.createUnstarted(ticker); }
From source file:io.wcm.caravan.pipeline.impl.operators.PerformanceMetricsTransformer.java
/** * constructor for unit-tests that allows you to specify a custom ticker. For general usage use * {@link #withSystemTicker(Transformer)} * @param toMeasure the transformer that should be measured * @param ticker the time source//from www . j a v a 2s .c o m */ PerformanceMetricsTransformer(Transformer<T, T> toMeasure, Ticker ticker) { super(); this.toMeasure = toMeasure; subscriptionStopwatch = Stopwatch.createUnstarted(ticker); observationStopwatch = Stopwatch.createUnstarted(ticker); emissionStopwatch = Stopwatch.createUnstarted(ticker); }
From source file:at.ac.univie.isc.asio.database.EventfulMysqlInterceptor.java
@VisibleForTesting EventfulMysqlInterceptor(final Ticker time, final Emitter events) { this.events = events; this.time = Stopwatch.createUnstarted(time); }
From source file:io.grpc.testing.GrpcCleanupRule.java
/** * Sets a specified time source for monitoring cleanup timeout. * * @return this/*w w w .j av a 2 s .c o m*/ */ @SuppressWarnings("BetaApi") // Test only. @VisibleForTesting GrpcCleanupRule setTicker(Ticker ticker) { this.stopwatch = Stopwatch.createUnstarted(ticker); return this; }
From source file:org.opendaylight.controller.cluster.common.actor.MessageTracker.java
@VisibleForTesting MessageTracker(final Class<?> expectedMessageClass, final long expectedArrivalIntervalInMillis, final Ticker ticker) { Preconditions.checkArgument(expectedArrivalIntervalInMillis >= 0); this.expectedMessageClass = Preconditions.checkNotNull(expectedMessageClass); this.expectedArrivalInterval = MILLISECONDS.toNanos(expectedArrivalIntervalInMillis); this.ticker = Preconditions.checkNotNull(ticker); this.expectedMessageWatch = Stopwatch.createUnstarted(ticker); this.currentMessageContext = new CurrentMessageContext(); }