/** * Stop a timer of the given string name for the given thread. If no such * timer exists, -1 will be returned. Otherwise the return value is the CPU * time that was measured. * * @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 * @return CPU time if timer existed and was running, and -1 otherwise */ public static long stopNamedTimer(String timerName, int todoFlags, long threadId) { ElkTimer key = new ElkTimer(timerName, todoFlags, threadId); if (registeredTimers.containsKey(key)) { return registeredTimers.get(key).stop(); } else { return -1; } }
/** * Stop a timer of the given string name for the given thread. If no such * timer exists, -1 will be returned. Otherwise the return value is the CPU * time that was measured. * * @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 * @return CPU time if timer existed and was running, and -1 otherwise */ public static long stopNamedTimer(String timerName, int todoFlags, long threadId) { ElkTimer key = new ElkTimer(timerName, todoFlags, threadId); if (registeredTimers.containsKey(key)) { return registeredTimers.get(key).stop(); } else { return -1; } }
/** * Stop a timer of the given string name for the given thread. If no such * timer exists, -1 will be returned. Otherwise the return value is the CPU * time that was measured. * * @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 * @return CPU time if timer existed and was running, and -1 otherwise */ public static long stopNamedTimer(String timerName, int todoFlags, long threadId) { ElkTimer key = new ElkTimer(timerName, todoFlags, threadId); if (registeredTimers.containsKey(key)) { return registeredTimers.get(key).stop(); } else { return -1; } }
/** * Stop a timer of the given string name for the given thread. If no such * timer exists, -1 will be returned. Otherwise the return value is the CPU * time that was measured. * * @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 * @return CPU time if timer existed and was running, and -1 otherwise */ public static long stopNamedTimer(String timerName, int todoFlags, long threadId) { ElkTimer key = new ElkTimer(timerName, todoFlags, threadId); if (registeredTimers.containsKey(key)) { return registeredTimers.get(key).stop(); } else { return -1; } }
/** * Log the end of a particular operation the beginning of which has been * logged using logOperationStart(), using the given logging priority. * * @param operationName * @param logger * @param priority */ public static void logOperationFinish(String operationName, Logger logger, Priority priority) { if (logger.isEnabledFor(priority)) { ElkTimer timer = ElkTimer.getNamedTimer(operationName, ElkTimer.RECORD_WALLTIME); timer.stop(); logger.log(priority, operationName + " took " + timer.getTotalWallTime() / 1000000 + " ms"); } }
/** * Log the end of a particular operation the beginning of which has been * logged using logOperationStart(), using the given logging priority. * * @param operationName * @param logger * @param priority */ public static void logOperationFinish(String operationName, Logger logger, LogLevel priority) { if (LoggerWrap.isEnabledFor(logger, priority)) { ElkTimer timer = ElkTimer.getNamedTimer(operationName, ElkTimer.RECORD_WALLTIME); timer.stop(); LoggerWrap.log(logger, priority, operationName + " took " + timer.getTotalWallTime() / 1000000 + " ms"); } }
/** * Log the end of a particular operation the beginning of which has been * logged using logOperationStart(), using the given logging priority. * * @param operationName * @param logger * @param priority */ public static void logOperationFinish(String operationName, Logger logger, LogLevel priority) { if (LoggerWrap.isEnabledFor(logger, priority)) { ElkTimer timer = ElkTimer.getNamedTimer(operationName, ElkTimer.RECORD_WALLTIME); timer.stop(); LoggerWrap.log(logger, priority, operationName + " took " + timer.getTotalWallTime() / 1000000 + " ms"); } }
/** * Log the end of a particular operation the beginning of which has been * logged using logOperationStart(), using the given logging priority. * * @param operationName * @param logger * @param priority */ public static void logOperationFinish(String operationName, Logger logger, LogLevel priority) { if (LoggerWrap.isEnabledFor(logger, priority)) { ElkTimer timer = ElkTimer.getNamedTimer(operationName, ElkTimer.RECORD_WALLTIME); timer.stop(); LoggerWrap.log(logger, priority, operationName + " took " + timer.getTotalWallTime() / 1000000 + " ms"); } }
@Override public void execute(ReasonerStage stage) throws ElkException { super.execute(stage); // FIXME: get rid of casts try { for (PostProcessingStage ppStage : instantiate( postProcesingMap.get(stage.getClass()), ((AbstractReasonerStage) stage).reasoner)) { ElkTimer.getNamedTimer(ppStage.getName()).start(); ppStage.execute(); ElkTimer.getNamedTimer(ppStage.getName()).stop(); } } catch (Exception e) { throw new ElkRuntimeException(e); } }