private static MonitorFactoryInterface getMonitorFactory(final String label) { MonitorFactoryInterface factory = monitorFactories.get(label); if (factory == null) { factory = new FactoryEnabled(); monitorFactories.put(label, factory); } return factory; }
private MonitorImp[] getMonitors() { Collection monitors=getAllMonitors(); if (monitors==null || monitors.size()==0) return null; else return (MonitorImp[]) monitors.toArray(new MonitorImp[0]); }
private MonitorImp getTimeMonitor(MonKey key, boolean isPrimary) { return getMonitor(key, isPrimary, TIME_MONITOR); }
private synchronized void initialize() { allActive=new Counter(); primaryActive=new Counter(); rangeFactory=new RangeFactory();// Builds Range objects activityTracking=false; setRangeDefault("ms.", RangeHolder.getMSHolder()); setRangeDefault("percent", RangeHolder.getPercentHolder()); setMap(Misc.createConcurrentMap(DEFAULT_MAP_SIZE)); if (isTotalKeySizeTrackingEnabled()) { enableTotalKeySizeTracking(); } addExceptionFifoBufferListener(); }
public Monitor getTimeMonitor(MonKey key) { return getTimeMonitor(key, NOT_PRIMARY); }
FactoryEnabled mf = new FactoryEnabled(); printDebug("totals", mf.getRootMonitor().getBasicData());
/** Pass in the units (or range type) and return all monitors of that * type. 'AllMonitors' is a special argument returns a composite of surprise surprise all monitors *getComposite("AllMonitors") is the same as getRootMonitor() ; **/ public MonitorComposite getComposite(String units) { return new MonitorComposite(getMonitors(units)); }
/** Creates a new instance of MonFactoryEnabled. Also initializes the standard * JAMon time monitor range (ms.) */ public FactoryEnabled() { initialize(); }
/** Pass in the units (or range type) and return all monitors of that * type. 'AllMonitors' is a special argument returns a composite of surprise surprise all monitors *getComposite("AllMonitors") is the same as getRootMonitor() ; **/ public MonitorComposite getComposite(String units) { return getRootMonitor().filterByUnits(units); }
private synchronized void initialize() { map = Collections.synchronizedMap(new HashMap(500)); allActive=new Counter(); primaryActive=new Counter(); rangeFactory=new RangeFactory();// Builds Range objects setRangeDefault("ms.", RangeHolder.getMSHolder()); setRangeDefault("percent", RangeHolder.getPercentHolder()); }
@Override public Monitor addException(Throwable throwable) { return addException(null, throwable); }
public Monitor getTimeMonitor(MonKey key) { return getTimeMonitor(key, NOT_PRIMARY); }
public void enableActivityTracking(boolean enable) { this.activityTracking=enable; // enable/disable any already created monitors Monitor[] monitors=getMonitors(); int len=(monitors==null) ? 0 : monitors.length; for (int i=0;i<len;i++) monitors[i].setActivityTracking(enable); }
/** Creates a new instance of MonFactoryEnabled. Also initializes the standard * JAMon time monitor range (ms.) */ public FactoryEnabled() { initialize(); }
public Monitor getTimeMonitor(String label) { return getTimeMonitor(new MonKeyImp(label, "ms."), NOT_PRIMARY); }
private MonitorImp getTimeMonitor(MonKey key, boolean isPrimary) { return getMonitor(key, isPrimary, TIME_MONITOR); }
/** * Reset/remove all monitors. If the factory is disabled this method has no * action. */ public static void reset() { if (isEnabled()) enabledFactory = factory = new FactoryEnabled(); }
/** getComposite("AllMonitors") is the same as getRootMonitor() */ public MonitorComposite getRootMonitor() { return new MonitorComposite(getMonitors()); }
/** Wipe out existing jamon data. Same as instantiating a new FactoryEnabled object. */ public void reset() { initialize(); }
private MonitorImp[] getMonitors() { Collection monitors=getAllMonitors(); if (monitors==null || monitors.size()==0) return null; else return (MonitorImp[]) monitors.toArray(new MonitorImp[0]); }