private void startTimer() { logger.info("Starting processing."); this.timer.start(); }
/** * Start a timer of the given string name for all todos and the current * thread. If no such timer exists yet, then it will be newly created. * * @param timerName * the name of the timer */ public static void startNamedTimer(String timerName) { getNamedTimer(timerName).start(); }
/** * Start a timer of the given string name for the current thread. If no such * timer exists yet, then it will be newly created. * * @param timerName * the name of the timer * @param todoFlags */ public static void startNamedTimer(String timerName, int todoFlags) { getNamedTimer(timerName, todoFlags).start(); }
/** * Start a timer of the given string name for the current thread. If no such * timer exists yet, then it will be newly created. * * @param timerName * the name of the timer * @param todoFlags */ public static void startNamedTimer(String timerName, int todoFlags) { getNamedTimer(timerName, todoFlags).start(); }
/** * Start a timer of the given string name for all todos and the current * thread. If no such timer exists yet, then it will be newly created. * * @param timerName * the name of the timer */ public static void startNamedTimer(String timerName) { getNamedTimer(timerName).start(); }
/** * Start a timer of the given string name for the current thread. If no such * timer exists yet, then it will be newly created. * * @param timerName * the name of the timer * @param todoFlags * @param threadId * of the thread to track, or 0 if only system clock should be * tracked */ public static void startNamedTimer(String timerName, int todoFlags, long threadId) { getNamedTimer(timerName, todoFlags, threadId).start(); }
/** * Start a timer of the given string name for the current thread. If no such * timer exists yet, then it will be newly created. * * @param timerName * the name of the timer * @param todoFlags * @param threadId * of the thread to track, or 0 if only system clock should be * tracked */ public static void startNamedTimer(String timerName, int todoFlags, long threadId) { getNamedTimer(timerName, todoFlags, threadId).start(); }
@Override public void startRevisionProcessing(String siteName, String baseUrl, Map<Integer, String> namespaces) { this.currentRevisionCount = 0; if (!this.totalTimer.isRunning()) { this.totalTimer.reset(); this.totalTimer.start(); } this.currentTimer.reset(); this.currentTimer.start(); StatisticsMwRevisionProcessor.logger.info("[" + this.name + "] Starting processing run for \"" + siteName + "\" (" + baseUrl + ")."); StatisticsMwRevisionProcessor.logger.info("[" + this.name + "] Namespaces: " + namespaces.toString()); }
void logProgress() { this.currentTimer.stop(); this.totalTimer.stop(); if (this.totalRevisionCount > 0) { StatisticsMwRevisionProcessor.logger.info("[" + this.name + "] Processed " + this.totalRevisionCount + " revisions (total) in " + this.totalTimer.getTotalWallTime() / 1000000000 + "s (wall)/" + this.totalTimer.getTotalCpuTime() / 1000000000 + "s (cpu). " + "Time per revision (mics): " + this.totalTimer.getTotalWallTime() / this.totalRevisionCount / 1000 + "/" + this.totalTimer.getTotalCpuTime() / this.totalRevisionCount / 1000); } if (this.currentRevisionCount > 0) { StatisticsMwRevisionProcessor.logger.info("[" + this.name + "] Processed " + this.currentRevisionCount + " revisions (current run) in " + this.currentTimer.getTotalWallTime() / 1000000000 + "s (wall)/" + this.currentTimer.getTotalCpuTime() / 1000000000 + "s (cpu)." + " Time per revision (mics): " + this.currentTimer.getTotalWallTime() / this.currentRevisionCount / 1000 + "/" + this.currentTimer.getTotalCpuTime() / this.currentRevisionCount / 1000); } this.currentTimer.start(); this.totalTimer.start(); }
/** * Counts one entity. Every once in a while, the current time is checked so * as to print an intermediate report roughly every ten seconds. */ private void countEntity() { if (!this.timer.isRunning()) { startTimer(); } this.entityCount++; if (this.entityCount % 100 == 0) { timer.stop(); int seconds = (int) (timer.getTotalWallTime() / 1000000000); if (seconds >= this.lastSeconds + this.reportInterval) { this.lastSeconds = seconds; printStatus(); if (this.timeout > 0 && seconds > this.timeout) { logger.info("Timeout. Aborting processing."); throw new TimeoutException(); } } timer.start(); } }