/external/guava/guava-gwt/test-super/com/google/common/testing/super/com/google/common/testing/ |
D | FakeTickerTest.java | 35 FakeTicker ticker = new FakeTicker(); in testAdvance() local 36 assertEquals(0, ticker.read()); in testAdvance() 37 assertSame(ticker, ticker.advance(10)); in testAdvance() 38 assertEquals(10, ticker.read()); in testAdvance() 39 ticker.advance(1, TimeUnit.MILLISECONDS); in testAdvance() 40 assertEquals(1000010L, ticker.read()); in testAdvance() 44 FakeTicker ticker = new FakeTicker(); in testAutoIncrementStep_returnsSameInstance() local 45 assertSame(ticker, ticker.setAutoIncrementStep(10, TimeUnit.NANOSECONDS)); in testAutoIncrementStep_returnsSameInstance() 49 FakeTicker ticker = new FakeTicker().setAutoIncrementStep(10, TimeUnit.NANOSECONDS); in testAutoIncrementStep_nanos() local 50 assertEquals(0, ticker.read()); in testAutoIncrementStep_nanos() [all …]
|
/external/guava/guava-testlib/test/com/google/common/testing/ |
D | FakeTickerTest.java | 46 FakeTicker ticker = new FakeTicker(); in testAdvance() local 47 assertEquals(0, ticker.read()); in testAdvance() 48 assertSame(ticker, ticker.advance(10)); in testAdvance() 49 assertEquals(10, ticker.read()); in testAdvance() 50 ticker.advance(1, TimeUnit.MILLISECONDS); in testAdvance() 51 assertEquals(1000010L, ticker.read()); in testAdvance() 55 FakeTicker ticker = new FakeTicker(); in testAutoIncrementStep_returnsSameInstance() local 56 assertSame(ticker, ticker.setAutoIncrementStep(10, TimeUnit.NANOSECONDS)); in testAutoIncrementStep_returnsSameInstance() 60 FakeTicker ticker = new FakeTicker().setAutoIncrementStep(10, TimeUnit.NANOSECONDS); in testAutoIncrementStep_nanos() local 61 assertEquals(0, ticker.read()); in testAutoIncrementStep_nanos() [all …]
|
/external/guava/guava-tests/test/com/google/common/base/ |
D | StopwatchTest.java | 37 private final FakeTicker ticker = new FakeTicker(); field in StopwatchTest 38 private final Stopwatch stopwatch = new Stopwatch(ticker); 98 ticker.advance(1); in testReset_new() 101 ticker.advance(2); in testReset_new() 104 ticker.advance(3); in testReset_new() 109 ticker.advance(1); in testReset_whileRunning() 112 ticker.advance(2); in testReset_whileRunning() 116 ticker.advance(3); in testReset_whileRunning() 121 ticker.advance(78); in testElapsed_whileRunning() 125 ticker.advance(345); in testElapsed_whileRunning() [all …]
|
/external/guava/guava-tests/test/com/google/common/cache/ |
D | CacheExpirationTest.java | 50 FakeTicker ticker = new FakeTicker(); in testExpiration_expireAfterWrite() local 56 .ticker(ticker) in testExpiration_expireAfterWrite() 58 checkExpiration(cache, loader, ticker, removalListener); in testExpiration_expireAfterWrite() 62 FakeTicker ticker = new FakeTicker(); in testExpiration_expireAfterAccess() local 68 .ticker(ticker) in testExpiration_expireAfterAccess() 70 checkExpiration(cache, loader, ticker, removalListener); in testExpiration_expireAfterAccess() 74 FakeTicker ticker, CountingRemovalListener<String, Integer> removalListener) { in checkExpiration() argument 86 CacheTesting.expireEntries((LoadingCache<?, ?>) cache, EXPIRING_TIME, ticker); in checkExpiration() local 92 CacheTesting.expireEntries((LoadingCache<?, ?>) cache, EXPIRING_TIME, ticker); in checkExpiration() local 99 FakeTicker ticker = new FakeTicker(); in testExpiringGet_expireAfterWrite() local [all …]
|
D | CacheRefreshTest.java | 32 FakeTicker ticker = new FakeTicker(); in testAutoRefresh() local 38 .ticker(ticker) in testAutoRefresh() 47 ticker.advance(1, MILLISECONDS); in testAutoRefresh() 57 ticker.advance(1, MILLISECONDS); in testAutoRefresh() 67 ticker.advance(1, MILLISECONDS); in testAutoRefresh() 75 ticker.advance(1, MILLISECONDS); in testAutoRefresh() 83 ticker.advance(1, MILLISECONDS); in testAutoRefresh() 91 ticker.advance(1, MILLISECONDS); in testAutoRefresh()
|
D | CacheBuilderGwtTest.java | 139 .ticker(fakeTicker) in testExpireAfterAccess() 156 .ticker(fakeTicker) in testExpireAfterWrite() 184 .ticker(fakeTicker) in testExpireAfterWriteAndAccess() 282 .ticker(fakeTicker) in testRemovalListener() 379 .ticker(fakeTicker) in testAsMap_containsValue() 397 .ticker(fakeTicker) in testAsMap_containsKey() 415 .ticker(fakeTicker) in testAsMapValues_contains() 433 .ticker(fakeTicker) in testAsMapKeySet() 455 .ticker(fakeTicker) in testAsMapKeySet_contains() 473 .ticker(fakeTicker) in testAsMapEntrySet() [all …]
|
/external/guava/guava-gwt/test-super/com/google/common/base/super/com/google/common/base/ |
D | StopwatchTest.java | 36 private final FakeTicker ticker = new FakeTicker(); field in StopwatchTest 37 private final Stopwatch stopwatch = new Stopwatch(ticker); 97 ticker.advance(1); in testReset_new() 100 ticker.advance(2); in testReset_new() 103 ticker.advance(3); in testReset_new() 108 ticker.advance(1); in testReset_whileRunning() 111 ticker.advance(2); in testReset_whileRunning() 115 ticker.advance(3); in testReset_whileRunning() 120 ticker.advance(78); in testElapsed_whileRunning() 124 ticker.advance(345); in testElapsed_whileRunning() [all …]
|
/external/jemalloc/include/jemalloc/internal/ |
D | ticker.h | 24 void ticker_init(ticker_t *ticker, int32_t nticks); 25 void ticker_copy(ticker_t *ticker, const ticker_t *other); 26 int32_t ticker_read(const ticker_t *ticker); 27 bool ticker_ticks(ticker_t *ticker, int32_t nticks); 28 bool ticker_tick(ticker_t *ticker); 33 ticker_init(ticker_t *ticker, int32_t nticks) in ticker_init() argument 36 ticker->tick = nticks; in ticker_init() 37 ticker->nticks = nticks; in ticker_init() 41 ticker_copy(ticker_t *ticker, const ticker_t *other) in ticker_copy() argument 44 *ticker = *other; in ticker_copy() [all …]
|
/external/jemalloc_new/include/jemalloc/internal/ |
D | ticker.h | 20 ticker_init(ticker_t *ticker, int32_t nticks) { in ticker_init() argument 21 ticker->tick = nticks; in ticker_init() 22 ticker->nticks = nticks; in ticker_init() 26 ticker_copy(ticker_t *ticker, const ticker_t *other) { in ticker_copy() argument 27 *ticker = *other; in ticker_copy() 31 ticker_read(const ticker_t *ticker) { in ticker_read() argument 32 return ticker->tick; in ticker_read() 59 ticker_fixup(ticker_t *ticker) { in ticker_fixup() argument 60 ticker->tick = ticker->nticks; in ticker_fixup() 65 ticker_ticks(ticker_t *ticker, int32_t nticks) { in ticker_ticks() argument [all …]
|
/external/grpc-grpc-java/context/src/test/java/io/grpc/ |
D | DeadlineTest.java | 56 private FakeTicker ticker = new FakeTicker(); field in DeadlineTest 59 ticker.reset(epoch); in DeadlineTest() 65 ticker.reset(System.nanoTime()); in defaultTickerIsSystemTicker() 66 Deadline reference = Deadline.after(0, TimeUnit.SECONDS, ticker); in defaultTickerIsSystemTicker() 73 ticker.reset(Long.MAX_VALUE); in timeCanOverflow() 74 Deadline d = Deadline.after(10, TimeUnit.DAYS, ticker); in timeCanOverflow() 76 assertTrue(Deadline.after(0, TimeUnit.DAYS, ticker).isBefore(d)); in timeCanOverflow() 79 ticker.increment(10, TimeUnit.DAYS); in timeCanOverflow() 85 ticker.reset(Long.MIN_VALUE); in timeCanUnderflow() 86 Deadline d = Deadline.after(-10, TimeUnit.DAYS, ticker); in timeCanUnderflow() [all …]
|
/external/jemalloc/test/unit/ |
D | ticker.c | 7 ticker_t ticker; in TEST_BEGIN() local 10 ticker_init(&ticker, NTICKS); in TEST_BEGIN() 13 assert_u_eq(ticker_read(&ticker), NTICKS - j, in TEST_BEGIN() 15 assert_false(ticker_tick(&ticker), in TEST_BEGIN() 18 assert_u32_eq(ticker_read(&ticker), 0, in TEST_BEGIN() 20 assert_true(ticker_tick(&ticker), in TEST_BEGIN() 22 assert_u32_eq(ticker_read(&ticker), NTICKS, in TEST_BEGIN() 32 ticker_t ticker; in TEST_BEGIN() local 34 ticker_init(&ticker, NTICKS); in TEST_BEGIN() 36 assert_u_eq(ticker_read(&ticker), NTICKS, "Unexpected ticker value"); in TEST_BEGIN() [all …]
|
/external/jemalloc_new/test/unit/ |
D | ticker.c | 8 ticker_t ticker; in TEST_BEGIN() local 11 ticker_init(&ticker, NTICKS); in TEST_BEGIN() 14 assert_u_eq(ticker_read(&ticker), NTICKS - j, in TEST_BEGIN() 16 assert_false(ticker_tick(&ticker), in TEST_BEGIN() 19 assert_u32_eq(ticker_read(&ticker), 0, in TEST_BEGIN() 21 assert_true(ticker_tick(&ticker), in TEST_BEGIN() 23 assert_u32_eq(ticker_read(&ticker), NTICKS, in TEST_BEGIN() 32 ticker_t ticker; in TEST_BEGIN() local 34 ticker_init(&ticker, NTICKS); in TEST_BEGIN() 36 assert_u_eq(ticker_read(&ticker), NTICKS, "Unexpected ticker value"); in TEST_BEGIN() [all …]
|
/external/grpc-grpc-java/netty/src/test/java/io/grpc/netty/ |
D | KeepAliveEnforcerTest.java | 31 private FakeTicker ticker = new FakeTicker(); field in KeepAliveEnforcerTest 45 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(true, 0, TimeUnit.NANOSECONDS, ticker); in permitLimitless() 65 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(false, 0, TimeUnit.NANOSECONDS, ticker); in strikeOutBecauseNoOutstandingCalls() 75 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(false, 0, TimeUnit.NANOSECONDS, ticker); in startsIdle() 84 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(true, 1, TimeUnit.NANOSECONDS, ticker); in strikeOutBecauseRateTooHighWhileActive() 94 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(true, 1, TimeUnit.NANOSECONDS, ticker); in strikeOutBecauseRateTooHighWhileIdle() 104 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(false, 1, TimeUnit.NANOSECONDS, ticker); in permitInRateWhileActive() 108 ticker.nanoTime += 1; in permitInRateWhileActive() 114 KeepAliveEnforcer enforcer = new KeepAliveEnforcer(true, 1, TimeUnit.NANOSECONDS, ticker); in permitInRateWhileIdle() 118 ticker.nanoTime += 1; in permitInRateWhileIdle() [all …]
|
D | MaxConnectionIdleManagerTest.java | 39 private final Ticker ticker = new Ticker() { field in MaxConnectionIdleManagerTest 57 spy(new TestMaxConnectionIdleManager(123L, ticker)); in maxIdleReached() 69 spy(new TestMaxConnectionIdleManager(123L, ticker)); in maxIdleNotReachedAndReached() 94 spy(new TestMaxConnectionIdleManager(123L, ticker)); in shutdownThenMaxIdleReached() 105 TestMaxConnectionIdleManager(long maxConnectionIdleInNanos, Ticker ticker) { in TestMaxConnectionIdleManager() argument 106 super(maxConnectionIdleInNanos, ticker); in TestMaxConnectionIdleManager()
|
/external/grpc-grpc-java/context/src/main/java/io/grpc/ |
D | Deadline.java | 51 static Deadline after(long duration, TimeUnit units, Ticker ticker) { in after() argument 53 return new Deadline(ticker, units.toNanos(duration), true); in after() 56 private final Ticker ticker; field in Deadline 60 private Deadline(Ticker ticker, long offset, boolean baseInstantAlreadyExpired) { in Deadline() argument 61 this(ticker, ticker.read(), offset, baseInstantAlreadyExpired); in Deadline() 64 private Deadline(Ticker ticker, long baseInstant, long offset, in Deadline() argument 66 this.ticker = ticker; in Deadline() 79 if (deadlineNanos - ticker.read() <= 0) { in isExpired() 114 return new Deadline(ticker, deadlineNanos, units.toNanos(offset), isExpired()); in offset() 124 final long nowNanos = ticker.read(); in timeRemaining() [all …]
|
/external/guava/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/ |
D | Stopwatch.java | 76 private final Ticker ticker; field in Stopwatch 97 public static Stopwatch createUnstarted(Ticker ticker) { in createUnstarted() argument 98 return new Stopwatch(ticker); in createUnstarted() 117 public static Stopwatch createStarted(Ticker ticker) { in createStarted() argument 118 return new Stopwatch(ticker).start(); in createStarted() 139 Stopwatch(Ticker ticker) { in Stopwatch() argument 140 this.ticker = checkNotNull(ticker, "ticker"); in Stopwatch() 161 startTick = ticker.read(); in start() 173 long tick = ticker.read(); in stop() 193 return isRunning ? ticker.read() - startTick + elapsedNanos : elapsedNanos; in elapsedNanos()
|
/external/guava/guava/src/com/google/common/base/ |
D | Stopwatch.java | 77 private final Ticker ticker; field in Stopwatch 98 public static Stopwatch createUnstarted(Ticker ticker) { in createUnstarted() argument 99 return new Stopwatch(ticker); in createUnstarted() 118 public static Stopwatch createStarted(Ticker ticker) { in createStarted() argument 119 return new Stopwatch(ticker).start(); in createStarted() 140 Stopwatch(Ticker ticker) { in Stopwatch() argument 141 this.ticker = checkNotNull(ticker, "ticker"); in Stopwatch() 162 startTick = ticker.read(); in start() 174 long tick = ticker.read(); in stop() 194 return isRunning ? ticker.read() - startTick + elapsedNanos : elapsedNanos; in elapsedNanos()
|
/external/caliper/caliper/src/main/java/com/google/caliper/worker/ |
D | RuntimeWorker.java | 45 protected final Ticker ticker; field in RuntimeWorker 52 Method method, Random random, Ticker ticker, in RuntimeWorker() argument 57 this.ticker = ticker; in RuntimeWorker() 105 @BenchmarkMethod Method method, Random random, Ticker ticker, in Micro() argument 107 super(benchmark, method, random, ticker, workerOptions); in Micro() 120 long before = ticker.read(); in invokeTimeMethod() 122 return ticker.read() - before; in invokeTimeMethod() 131 @BenchmarkMethod Method method, Random random, Ticker ticker, in Pico() argument 133 super(benchmark, method, random, ticker, workerOptions); in Pico() 137 long before = ticker.read(); in invokeTimeMethod() [all …]
|
/external/grpc-grpc-java/netty/src/main/java/io/grpc/netty/ |
D | MaxConnectionIdleManager.java | 39 private final Ticker ticker; field in MaxConnectionIdleManager 54 MaxConnectionIdleManager(long maxConnectionIdleInNanos, Ticker ticker) { in MaxConnectionIdleManager() argument 56 this.ticker = ticker; in MaxConnectionIdleManager() 67 nextIdleMonitorTime = ticker.nanoTime() + maxConnectionIdleInNanos; in start() 76 shutdownTask, nextIdleMonitorTime - ticker.nanoTime(), TimeUnit.NANOSECONDS); in start() 114 nextIdleMonitorTime = ticker.nanoTime() + maxConnectionIdleInNanos; in onTransportIdle()
|
D | KeepAliveEnforcer.java | 33 private final Ticker ticker; field in KeepAliveEnforcer 45 KeepAliveEnforcer(boolean permitWithoutCalls, long minTime, TimeUnit unit, Ticker ticker) { in KeepAliveEnforcer() argument 50 this.ticker = ticker; in KeepAliveEnforcer() 51 this.epoch = ticker.nanoTime(); in KeepAliveEnforcer() 58 long now = ticker.nanoTime(); in pingAcceptable()
|
/external/setupcompat/main/java/com/google/android/setupcompat/internal/ |
D | ClockProvider.java | 26 return ticker.read(); in timeInNanos() 35 ticker = SYSTEM_TICKER; in resetInstance() 40 ticker = () -> nanoSecondSupplier.get(); in setInstance() 44 return ticker.read(); in read() 48 private static Ticker ticker = SYSTEM_TICKER; field in ClockProvider
|
/external/grpc-grpc-java/core/src/main/java/io/grpc/internal/ |
D | KeepAliveManager.java | 38 private final Ticker ticker; field in KeepAliveManager 78 nextKeepaliveTime - ticker.read(), 134 Ticker ticker, long keepAliveTimeInNanos, long keepAliveTimeoutInNanos, in KeepAliveManager() argument 138 this.ticker = checkNotNull(ticker, "ticker"); in KeepAliveManager() 142 nextKeepaliveTime = ticker.read() + keepAliveTimeInNanos; in KeepAliveManager() 156 nextKeepaliveTime = ticker.read() + keepAliveTimeInNanos; in onDataReceived() 191 nextKeepaliveTime - ticker.read(), in onTransportActive()
|
/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/ |
D | KeepAliveManagerTest.java | 45 private final FakeTicker ticker = new FakeTicker(); field in KeepAliveManagerTest 65 keepAliveManager = new KeepAliveManager(keepAlivePinger, scheduler, ticker, 1000, 2000, false); in setUp() 70 ticker.time = 1; in sendKeepAlivePings() 85 ticker.time = 1000; in sendKeepAlivePings() 95 ticker.time = 1100; in sendKeepAlivePings() 120 ticker.time = 1500; in keepAlivePingDelayedByIncomingData() 122 ticker.time = 1600; in keepAlivePingDelayedByIncomingData() 180 ticker.time = 1000; in onTransportTerminationCancelsShutdownFuture() 202 ticker.time = 1000; in keepAlivePingTimesOut() 212 ticker.time = 3000; in keepAlivePingTimesOut() [all …]
|
/external/guava/guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/ |
D | LocalCache.java | 60 private final Ticker ticker; field in LocalCache 81 this.ticker = firstNonNull(builder.ticker, Ticker.systemTicker()); in LocalCache() 119 Timestamped<V> oldValue = cachingHashMap.put(key, new Timestamped<V>(value, ticker)); in put() 235 return ticker.read(); in currentTimeNanos() 245 long startTime = ticker.read(); in load() 261 statsCounter.recordLoadException(ticker.read() - startTime); in load() 264 statsCounter.recordLoadException(ticker.read() - startTime); in load() 267 statsCounter.recordLoadException(ticker.read() - startTime); in load() 275 statsCounter.recordLoadSuccess(ticker.read() - startTime); in load() 305 private final Ticker ticker; field in LocalCache.Timestamped [all …]
|
D | CacheBuilder.java | 230 Ticker ticker; field in CacheBuilder 455 public CacheBuilder<K, V> ticker(Ticker ticker) { in ticker() argument 456 checkState(this.ticker == null); in ticker() 457 this.ticker = checkNotNull(ticker); in ticker() 462 if (ticker != null) { in getTicker() 463 return ticker; in getTicker()
|