public void reset() { super.reset(); startTime=0; }
@Override public Monitor start() { super.start(); startTime=System.currentTimeMillis(); return this; }
@Override public Object getValue(String key) { if ("starttime".equalsIgnoreCase(key)) { return new Long(startTime); } else { return super.getValue(key); } }
public Monitor stop() { long endTime=System.currentTimeMillis(); setAccessStats(endTime);// saves some cycles by not recalculating time for time monitors add(endTime-startTime);// accrue status super.stop();// decrement active. return this; }
/***This was changed 11/24/06 to fix syncronization problems reported as bug */ private MonitorImp getMonitor(MonKey key, boolean isPrimary, boolean isTimeMonitor) { MonitorImp mon=getMonitor.getMon(key, isPrimary, isTimeMonitor); if (mon.isEnabled()) { mon = (isTimeMonitor) ? new TimeMon(key, mon.getMonInternals()) : new DecoMon(key, mon.getMonInternals()); } return mon; }
@Override public Monitor stop() { long endTime=System.currentTimeMillis(); setAccessStats(endTime);// saves some cycles by not recalculating time for time monitors add(endTime-startTime);// accrue status super.stop();// decrement active. return this; }
/***This was changed 11/24/06 to fix syncronization problems reported as bug */ private synchronized MonitorImp getMonitor(MonKey key, boolean isPrimary, boolean isTimeMonitor) { // note using MonKey over String concatenation doubled the speed // of the code, and was only slightly slower than using just the label // as the key MonitorImp mon=getExistingMonitor(key); // chance of 2 threads going into the next code simultaneously if (mon==null) { mon=createMon(key, isPrimary, isTimeMonitor); putMon(key, mon); } if (mon.isEnabled()) { mon = (isTimeMonitor) ? new TimeMon(key, mon.getMonInternals()) : new DecoMon(key, mon.getMonInternals()); } return mon; }
public Monitor start() { super.start(); startTime=System.currentTimeMillis(); return this; }
@Override public Monitor stop() { long endTime=System.nanoTime(); setAccessStats(endTime/NANOSECS_PER_MILLISEC);// saves some cycles by not recalculating time for time monitors add(endTime-startTime);// accrue status super.stop();// decrement active. return this; }
@Override public void reset() { super.reset(); startTime=0; }
@Override public Object getValue(String key) { if ("starttime".equalsIgnoreCase(key)) return new Long(startTime); else return super.getValue(key); }
@Override public Monitor start() { super.start(); startTime=System.nanoTime(); return this; }
@Override public void reset() { super.reset(); startTime=0; } }