/** * Enable MonitorFactory. When enabled the factory returns monitors that * store aggregate stats. This method has the same * * effect as calling MonitorFactor.setEnabled(true). * */ public static void enable() { setEnabled(true); }
/** * Disable MonitorFactory. When disabled the factory returns null/noop * monitors. This method has the same * * effect as calling MonitorFactor.setEnabled(true). * */ public static void disable() { setEnabled(false); }
/** Disable MonitorFactory. When disabled the factory returns null/noop * monitors. This method has the same effect as calling MonitorFactor.setEnabled(true). */ public static void disable() { setEnabled(false); }
/** Enable MonitorFactory. When enabled the factory returns monitors that * store aggregate stats. This method has the same effect as calling MonitorFactor.setEnabled(true). */ public static void enable() { setEnabled(true); }
@Override public void setEnabled(boolean enable) { MonitorFactory.setEnabled(enable); }
public void nullMonitor2() throws Exception { // The null monitor has the best possible performance System.out.println("\nNullMonitor2() - Factory disabled so a NullMonitor is returned"); System.out.println("\tMonitorFactory.setEnabled(false);"); System.out.println("\tMonitor mon=MonitorFactory.start('pages.admin');"); System.out.println("\tmon.stop()"); MonitorFactory.setEnabled(false); for (int i=0; i<testIterations; i++) { testMon=MonitorFactory.start("pages.admin"); testMon.stop(); } MonitorFactory.setEnabled(true); }
public void nullMonitor2() throws Exception { // The null monitor has the best possible performance System.out.println("\nNullMonitor2() - Factory disabled so a NullMonitor is returned"); System.out.println("\tMonitorFactory.setEnabled(false);"); System.out.println("\tMonitor mon=MonitorFactory.start('pages.admin');"); System.out.println("\tmon.stop()"); MonitorFactory.setEnabled(false); for (int i=0; i<testIterations; i++) { testMon=MonitorFactory.start("pages.admin"); testMon.stop(); } MonitorFactory.setEnabled(true); }
public void nullMonitor() throws Exception { // The null monitor has the best possible performance, however it doesn't do anything so is only appropriate when monitoring // is disabled. System.out.println("\nNullMonitor() - Factory disabled so a NullMonitor is returned"); System.out.println("\tMonitorFactory.setEnabled(false);"); System.out.println("\tMonitor mon=MonitorFactory.start();"); System.out.println("\tmon.stop()"); MonitorFactory.setEnabled(false); for (int i=0; i<testIterations; i++) { testMon=MonitorFactory.start(); testMon.stop(); } MonitorFactory.setEnabled(true); }
public void nullMonitor() throws Exception { // The null monitor has the best possible performance, however it doesn't do anything so is only appropriate when monitoring // is disabled. System.out.println("\nNullMonitor() - Factory disabled so a NullMonitor is returned"); System.out.println("\tMonitorFactory.setEnabled(false);"); System.out.println("\tMonitor mon=MonitorFactory.start();"); System.out.println("\tmon.stop()"); MonitorFactory.setEnabled(false); for (int i=0; i<testIterations; i++) { testMon=MonitorFactory.start(); testMon.stop(); } MonitorFactory.setEnabled(true); }