public ProcessTimer(AdaptiveCongestionController congestionController) { m_timer = Stopwatch.createUnstarted(); m_adaptiveCongestionController = congestionController; }
public IngestFutureTask(Callable<Integer> callable) { super(callable); m_stopwatch = Stopwatch.createUnstarted(); }
public PolicyStats(String name) { this.name = requireNonNull(name); this.stopwatch = Stopwatch.createUnstarted(); }
public PipelineInterpreterTracer() { executionTrace = new ArrayList<>(); timer = Stopwatch.createUnstarted(); simulatorInterpreterListener = new SimulatorInterpreterListener(this); }
public DiffApplier(int diffParallelism, FileSource source, FileDestination destination) { Preconditions.checkNotNull(source); Preconditions.checkNotNull(destination); this.diffsFailedPaths = new ConcurrentSkipListSet<>(); this.refactoredPaths = Sets.newConcurrentHashSet(); this.source = source; this.destination = destination; this.completedFiles = new AtomicInteger(0); this.stopwatch = Stopwatch.createUnstarted(); // configure a bounded queue and a rejectedexecutionpolicy. // In this case CallerRuns may be appropriate. this.workerService = new ThreadPoolExecutor( 0, diffParallelism, 5, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(50), new ThreadPoolExecutor.CallerRunsPolicy()); }
final Stopwatch stopwatch = Stopwatch.createUnstarted();
@Override public void run() { Stopwatch sw = Stopwatch.createUnstarted(); Map<String, GarbageCollectorMXBean> gcBeanMapBeforeSleep = getGarbageCollectorMXBeans(); while (true) { sw.reset().start(); try { Thread.sleep(mGcSleepIntervalMs); } catch (InterruptedException ie) { LOG.warn(ie.getStackTrace()); return; } long extraTime = sw.elapsed(TimeUnit.MILLISECONDS) - mGcSleepIntervalMs; mTotalExtraTimeMs += extraTime; Map<String, GarbageCollectorMXBean> gcBeanMapAfterSleep = getGarbageCollectorMXBeans(); if (extraTime > mWarnThresholdMs) { mInfoTimeExceeded++; mWarnTimeExceeded++; LOG.warn(formatLogString(extraTime, gcBeanMapBeforeSleep, gcBeanMapAfterSleep)); } else if (extraTime > mInfoThresholdMs) { mInfoTimeExceeded++; LOG.info(formatLogString( extraTime, gcBeanMapBeforeSleep, gcBeanMapAfterSleep)); } gcBeanMapBeforeSleep = gcBeanMapAfterSleep; } } }
@Override public void run() { Stopwatch sw = Stopwatch.createUnstarted(); Map<String, GcTimes> gcTimesBeforeSleep = getGcTimes(); Counter jvmPauseWarnCnt = Metrics.getOrCreateCounter(MetricsConstants.JVM_PAUSE_WARN);
public void testCreateUnstarted() { Stopwatch unstartedStopwatch = Stopwatch.createUnstarted(); assertFalse(unstartedStopwatch.isRunning()); assertEquals(0, unstartedStopwatch.elapsed(NANOSECONDS)); }
@Override public void run() { Stopwatch sw = Stopwatch.createUnstarted(); Map<String, GcTimes> gcTimesBeforeSleep = getGcTimes(); while (shouldRun) { sw.reset().start(); try { Thread.sleep(SLEEP_INTERVAL_MS); } catch (InterruptedException ie) { return; } long extraSleepTime = sw.elapsed(TimeUnit.MILLISECONDS) - SLEEP_INTERVAL_MS; Map<String, GcTimes> gcTimesAfterSleep = getGcTimes(); if (extraSleepTime > warnThresholdMs) { ++numGcWarnThresholdExceeded; LOG.warn(formatMessage( extraSleepTime, gcTimesAfterSleep, gcTimesBeforeSleep)); incrementMetricsCounter(MetricsConstant.JVM_PAUSE_WARN, 1); } else if (extraSleepTime > infoThresholdMs) { ++numGcInfoThresholdExceeded; LOG.info(formatMessage( extraSleepTime, gcTimesAfterSleep, gcTimesBeforeSleep)); incrementMetricsCounter(MetricsConstant.JVM_PAUSE_INFO, 1); } incrementMetricsCounter(MetricsConstant.JVM_EXTRA_SLEEP, extraSleepTime); totalGcExtraSleepTime += extraSleepTime; gcTimesBeforeSleep = gcTimesAfterSleep; } }
protected final OpStatsLogger opStatsLogger; private final Promise<Response> result = new Promise<Response>(); protected final Stopwatch stopwatch = Stopwatch.createUnstarted(); protected final Long checksum; protected final Feature checksumDisabledFeature;
public static boolean conditionValid(IndexingServiceCondition condition, long timeout) { try { Stopwatch stopwatch = Stopwatch.createUnstarted(); stopwatch.start(); while (!condition.isValid()) { Thread.sleep(100); if (stopwatch.elapsed(TimeUnit.MILLISECONDS) > timeout) { throw new ISE("Condition[%s] not met", condition); } } } catch (Exception e) { log.warn(e, "Condition[%s] not met within timeout[%,d]", condition, timeout); return false; } return true; } }
stopwatch = Stopwatch.createUnstarted(); while (true) { try {
stopwatch = Stopwatch.createUnstarted(); while (true) { try {
ProgressLogger(Logger log) { logger = log; timer = Stopwatch.createUnstarted(); }
public void profileRun() Stopwatch watch = Stopwatch.createUnstarted(); LoadQueuePeonTester fromPeon = new LoadQueuePeonTester(); LoadQueuePeonTester toPeon = new LoadQueuePeonTester();
public void bigProfiler() Stopwatch watch = Stopwatch.createUnstarted(); int numSegments = 55000; int numServers = 50;
private TrackedJob(TrackedJob parent, String type, String description) { this.parent = parent; this.type = type; this.description = description; this.eventBus = parent.getEventBus(); this.uuid = UUID.randomUUID(); timer = Stopwatch.createUnstarted(); }
LOG.debug("Starting async reader at {}", startDLSN); this.startDLSN = startDLSN; this.scheduleDelayStopwatch = Stopwatch.createUnstarted(); this.readNextDelayStopwatch = Stopwatch.createStarted(); this.positionGapDetectionEnabled = bkdlm.getConf().getPositionGapDetectionEnabled();
this.tracker = new ReadAheadTracker(logMetadata.getLogName(), readAheadCache, ReadAheadPhase.SCHEDULE_READAHEAD, readAheadPerStreamStatsLogger); this.resumeStopWatch = Stopwatch.createUnstarted();