/** * */ package at.gv.egiz.pdfas.performance; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * @author wprinz */ public class PerformanceCounter { /** * The log. */ private static Log log = LogFactory.getLog(PerformanceCounter.class); protected String name = null; protected long counter = 0; public PerformanceCounter(String name) { this.name = name; reset(); } public PerformanceCounter(Class clazz) { this(clazz.getName()); } public void increment() { this.counter++; log.trace(this.name + ": incremented to " + this.counter); } public void reset() { this.counter = 0; log.trace(this.name + ": reset to 0"); } /** * @return the name */ public String getName() { return this.name; } /** * @return the counter */ public long getCounter() { return this.counter; } }