public SpeedForJOpTimer(String clusterName) { // // This uses speed4j.properties to instantiate a new logger. // pay attention to the naming scheme // stopWatchFactory = StopWatchFactory.getInstance("hector-"+clusterName); }
@Override public Object start(String tagName) { return stopWatchFactory.getStopWatch(); }
@Override public void stop(Object token, String tagName, boolean success) { ((StopWatch) token).stop(tagName.concat(success ? ".success_" : ".fail_")); }
/** * Returns a StopWatch for the given tag and given message. * * @param tag Tag which identifies this StopWatch. * @param message A free-form message. * @return A new StopWatch. */ public StopWatch getStopWatch( String tag, String message ) { return new LoggingStopWatch( m_log, tag, message ); }
/** * Returns the default StopWatchFactory, which contains no * Log configuration. * * @return The default StopWatchFactory. */ public static StopWatchFactory getDefault() { return new StopWatchFactory(null); }
/** * Stops the StopWatch. * * @return This StopWatch instance. */ public StopWatch stop() { internalStop(); return this; }
/** * Returns the elapsed time in microseconds. * * @return The elapsed time in microseconds. */ public long getTimeMicros() { return getTimeNanos() / 1000; }
private static synchronized Map<String, StopWatchFactory> getFactories() { if( c_factories == null ) configure(); return c_factories; }
/** * Returns a StopWatch for the given tag and null message. * * @param tag Tag which identifies this StopWatch. * @return A new StopWatch instance. */ public StopWatch getStopWatch( String tag ) { return getStopWatch( tag,null ); }
public SpeedForJOpTimer(String clusterName) { // // This uses speed4j.properties to instantiate a new logger. // pay attention to the naming scheme // stopWatchFactory = StopWatchFactory.getInstance("hector-"+clusterName); }
/** * Stops the StopWatch and assigns the given tag to it. * * @param tag The tag to assign. * @return This StopWatch. */ public StopWatch stop( String tag ) { m_tag = tag; stop(); return this; }
/** * Returns the default StopWatchFactory, which contains no * Log configuration. * * @return The default StopWatchFactory. */ public static StopWatchFactory getDefault() { return new StopWatchFactory(null); }
/** * Stops the StopWatch. * * @return This StopWatch instance. */ public StopWatch stop() { internalStop(); return this; }
/** * Returns the elapsed time in milliseconds. This method is a convenience method * for those upgrading from Perf4J. * * @return Elapsed time in milliseconds. */ public long getElapsedTime() { return getTimeNanos() / 1000000; }
/** * Return a StopWatch for an empty tag and empty message. * * @return A configured StopWatch. */ public StopWatch getStopWatch() { return getStopWatch(null,null); }
public SpeedForJOpTimer(String clusterName) { // // This uses speed4j.properties to instantiate a new logger. // pay attention to the naming scheme // stopWatchFactory = StopWatchFactory.getInstance("hector-"+clusterName); }
/** * Return new StopWatchFactory which uses the specified Log. You are fully * responsible for this StopWatchFactory for now, i.e. shutdown() does not * use this. * * @param logger * @return */ public static StopWatchFactory getInstance(Log logger) { return new StopWatchFactory(logger); }
/** * Return a StopWatch for an empty tag and empty message. * * @return A configured StopWatch. */ public StopWatch getStopWatch() { return getStopWatch(null,null); }
/** * Returns a StopWatch for the given tag and null message. * * @param tag Tag which identifies this StopWatch. * @return A new StopWatch instance. */ public StopWatch getStopWatch( String tag ) { return getStopWatch( tag,null ); }