/** * Constructor. * * @param name * a string name used in log messages to refer to this processor * @param logFrequency * the number of revisions after which an intermediate status * report should be logged; or -1 if no such reports should be * logged */ public StatisticsMwRevisionProcessor(String name, int logFrequency) { this.name = name; this.logFrequency = logFrequency; this.totalTimer = Timer.getNamedTimer(name + "-totalTimer", Timer.RECORD_ALL); this.currentTimer = Timer.getNamedTimer(name + "-currentTimer", Timer.RECORD_ALL); }
/** * Get a timer of the given string name that takes all possible times * (todos) for the current thread. If no such timer exists yet, then it will * be newly created. * * @param timerName * the name of the timer * @return timer */ public static Timer getNamedTimer(String timerName) { return getNamedTimer(timerName, RECORD_ALL, Thread.currentThread() .getId()); }
/** * Get a timer of the given string name and todos 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 * @return timer */ public static Timer getNamedTimer(String timerName, int todoFlags) { return getNamedTimer(timerName, todoFlags, Thread.currentThread() .getId()); }
/** * Get a timer of the given string name and todos 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 * @return timer */ public static Timer getNamedTimer(String timerName, int todoFlags) { return getNamedTimer(timerName, todoFlags, Thread.currentThread() .getId()); }
/** * Get a timer of the given string name that takes all possible times * (todos) for the current thread. If no such timer exists yet, then it will * be newly created. * * @param timerName * the name of the timer * @return timer */ public static Timer getNamedTimer(String timerName) { return getNamedTimer(timerName, RECORD_ALL, Thread.currentThread() .getId()); }
/** * 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(); }
/** * Reset 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 resetNamedTimer(String timerName) { getNamedTimer(timerName).reset(); }
/** * 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(); }
/** * Reset 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 resetNamedTimer(String timerName) { getNamedTimer(timerName).reset(); }
/** * Reset 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 resetNamedTimer(String timerName, int todoFlags) { getNamedTimer(timerName, todoFlags).reset(); }
/** * 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(); }
/** * Reset 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 resetNamedTimer(String timerName, int todoFlags) { getNamedTimer(timerName, todoFlags).reset(); }
/** * 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(); }
/** * Reset a timer of the given string name for the given 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 resetNamedTimer(String timerName, int todoFlags, long threadId) { getNamedTimer(timerName, todoFlags, threadId).reset(); }
/** * Reset a timer of the given string name for the given 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 resetNamedTimer(String timerName, int todoFlags, long threadId) { getNamedTimer(timerName, todoFlags, threadId).reset(); }
/** * 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(); }