org.javasimon.source.CachedStopwatchSource Maven / Gradle / Ivy
package org.javasimon.source;
import org.javasimon.Split;
import org.javasimon.Stopwatch;
/**
* Cached sources using {@link org.javasimon.Stopwatch} as monitors.
*
* @author Richard "Virgo" Richter
* @since 3.4
*/
public abstract class CachedStopwatchSource extends CachedMonitorSource implements StopwatchSource {
public CachedStopwatchSource(StopwatchSource delegate) {
super(delegate);
}
@Override
public Split start(L location) {
if (isMonitored(location)) {
return getMonitor(location).start();
}
return Split.DISABLED;
}
}