Refine search
@Override public void run() { LOGGER.info("[capacityManagement] start correct usage"); Stopwatch stopwatch = Stopwatch.createStarted(); correctUsage(); LOGGER.info("[capacityManagement] end correct usage, cost: {}s", stopwatch.elapsed(TimeUnit.SECONDS)); } }, PropertyUtil.getCorrectUsageDelay(), PropertyUtil.getCorrectUsageDelay(), TimeUnit.SECONDS);
@Override public void retain(String indexName, IndexSet indexSet) { final Stopwatch sw = Stopwatch.createStarted(); indices.delete(indexName); auditEventSender.success(AuditActor.system(nodeId), ES_INDEX_RETENTION_DELETE, ImmutableMap.of( "index_name", indexName, "retention_strategy", this.getClass().getCanonicalName() )); LOG.info("Finished index retention strategy [delete] for index <{}> in {}ms.", indexName, sw.stop().elapsed(TimeUnit.MILLISECONDS)); }
@Override public Void call() throws Exception { Stopwatch timeRun = duration != DEFAULT_DURATION ? Stopwatch.createStarted() : null; int numRuns = 0; do { numRuns++; callAndValidate(); } while ((iterations != DEFAULT_ITERATIONS && numRuns < iterations) || (duration != DEFAULT_DURATION && timeRun.elapsed(SECONDS) <= duration.getSeconds())); return null; }
@Override public void retain(String indexName, IndexSet indexSet) { final Stopwatch sw = Stopwatch.createStarted(); indices.close(indexName); auditEventSender.success(AuditActor.system(nodeId), ES_INDEX_RETENTION_CLOSE, ImmutableMap.of( "index_name", indexName, "retention_strategy", this.getClass().getCanonicalName() )); LOG.info("Finished index retention strategy [close] for index <{}> in {}ms.", indexName, sw.stop().elapsed(TimeUnit.MILLISECONDS)); }
@Override public byte[] compress(byte[] data, int offset, int length, OpStatsLogger compressionStat) { Preconditions.checkNotNull(data); Preconditions.checkArgument(offset >= 0 && offset < data.length); Preconditions.checkArgument(length >= 0); Preconditions.checkNotNull(compressionStat); Stopwatch watch = Stopwatch.createStarted(); byte[] compressed = compressor.compress(data, offset, length); compressionStat.registerSuccessfulEvent(watch.elapsed(TimeUnit.MICROSECONDS)); return compressed; }
@Override protected void shutDown() throws Exception { for (Periodical periodical : periodicals.getAllStoppedOnGracefulShutdown()) { LOG.info("Shutting down periodical [{}].", periodical.getClass().getCanonicalName()); Stopwatch s = Stopwatch.createStarted(); // Cancel future executions. Map<Periodical,ScheduledFuture> futures = periodicals.getFutures(); if (futures.containsKey(periodical)) { futures.get(periodical).cancel(false); s.stop(); LOG.info("Shutdown of periodical [{}] complete, took <{}ms>.", periodical.getClass().getCanonicalName(), s.elapsed(TimeUnit.MILLISECONDS)); } else { LOG.error("Could not find periodical [{}] in futures list. Not stopping execution.", periodical.getClass().getCanonicalName()); } } } }
@Override public T apply() { taskPendingTime.registerSuccessfulEvent(pendingStopwatch.elapsed(TimeUnit.MICROSECONDS)); Stopwatch executionStopwatch = Stopwatch.createStarted(); T result = function0.apply(); taskExecutionTime.registerSuccessfulEvent(executionStopwatch.elapsed(TimeUnit.MICROSECONDS)); long elapsed = executionStopwatch.elapsed(TimeUnit.MICROSECONDS); if (elapsed > traceTaskExecutionWarnTimeUs) { LOG.info("{} took too long {} microseconds", function0.toString(), elapsed); } return result; } }
void complete() { if (LOG.isTraceEnabled()) { LOG.trace("{} : Satisfied promise with {} records", bkLedgerManager.getFullyQualifiedName(), records.size()); } delayUntilPromiseSatisfied.registerSuccessfulEvent(enqueueTime.stop().elapsed(TimeUnit.MICROSECONDS)); Stopwatch stopwatch = Stopwatch.createStarted(); promise.setValue(records); futureSetLatency.registerSuccessfulEvent(stopwatch.stop().elapsed(TimeUnit.MICROSECONDS)); } }
@Override // length parameter is ignored here because of the way the fastDecompressor works. public byte[] decompress(byte[] data, int offset, int length, int decompressedSize, OpStatsLogger decompressionStat) { Preconditions.checkNotNull(data); Preconditions.checkArgument(offset >= 0 && offset < data.length); Preconditions.checkArgument(length >= 0); Preconditions.checkArgument(decompressedSize >= 0); Preconditions.checkNotNull(decompressionStat); Stopwatch watch = Stopwatch.createStarted(); byte[] decompressed = fastDecompressor.decompress(data, offset, decompressedSize); decompressionStat.registerSuccessfulEvent(watch.elapsed(TimeUnit.MICROSECONDS)); return decompressed; } }
@Override public void persist(final Committer committer) { final Stopwatch runExecStopwatch = Stopwatch.createStarted(); appenderator.persistAll(committer); final long startDelay = runExecStopwatch.elapsed(TimeUnit.MILLISECONDS); metrics.incrementPersistBackPressureMillis(startDelay); if (startDelay > WARN_DELAY) { log.warn("Ingestion was throttled for [%,d] millis because persists were pending.", startDelay); } runExecStopwatch.stop(); }
public void apply(Request request) throws OverCapacityException { Stopwatch stopwatch = Stopwatch.createStarted(); try { for (RequestLimiter<Request> limiter : limiters) { limiter.apply(request); } } finally { applyTime.registerSuccessfulEvent(stopwatch.elapsed(TimeUnit.MICROSECONDS)); } } }
void setException(Throwable throwable) { Stopwatch stopwatch = Stopwatch.createStarted(); if (promise.updateIfEmpty(new Throw<List<LogRecordWithDLSN>>(throwable))) { futureSetLatency.registerFailedEvent(stopwatch.stop().elapsed(TimeUnit.MICROSECONDS)); delayUntilPromiseSatisfied.registerFailedEvent(enqueueTime.elapsed(TimeUnit.MICROSECONDS)); } }
@Override public byte[] decompress(byte[] data, int offset, int length, OpStatsLogger decompressionStat) { Preconditions.checkNotNull(data); Preconditions.checkArgument(offset >= 0 && offset < data.length); Preconditions.checkArgument(length >= 0); Preconditions.checkNotNull(decompressionStat); Stopwatch watch = Stopwatch.createStarted(); // Assume that we have a compression ratio of 1/3. int outLength = length * 3; while (true) { try { byte[] decompressed = safeDecompressor.decompress(data, offset, length, outLength); decompressionStat.registerSuccessfulEvent(watch.elapsed(TimeUnit.MICROSECONDS)); return decompressed; } catch (LZ4Exception e) { outLength *= 2; } } }
checkNotNull(loader); checkNotNull(keys); Stopwatch stopwatch = Stopwatch.createStarted(); Map<K, V> result; boolean success = false; } finally { if (!success) { globalStatsCounter.recordLoadException(stopwatch.elapsed(NANOSECONDS)); globalStatsCounter.recordLoadException(stopwatch.elapsed(NANOSECONDS)); throw new InvalidCacheLoadException(loader + " returned null map from loadAll"); stopwatch.stop(); globalStatsCounter.recordLoadException(stopwatch.elapsed(NANOSECONDS)); throw new InvalidCacheLoadException(loader + " returned null keys or values from loadAll"); globalStatsCounter.recordLoadSuccess(stopwatch.elapsed(NANOSECONDS)); return result;