org.sormula.operation.monitor
Class NoOperationTime

java.lang.Object
  extended by org.sormula.operation.monitor.OperationTime
      extended by org.sormula.operation.monitor.NoOperationTime

public class NoOperationTime
extends OperationTime

Do nothing implementation when no timings are desired. This class provides a way to omit timing and avoid numerous not null checks in all places where timing is needed.

Since:
1.5
Author:
Jeff Miller

Constructor Summary
NoOperationTime()
           
 
Method Summary
 void cancel()
          Cancels recording active time.
 void pause()
          Stops recording the currently active time until OperationTime.resume() is invoked.
 void resume()
          Starts recording the active time that was paused.
 void startExecuteTime()
          Starts recording execute time.
 void startPrepareTime()
          Starts recording prepare time.
 void startReadTime()
          Starts recording read time.
 void startWriteTime()
          Starts recording write time.
 void stop()
          Stops recording the active time that was started with one of the start methods.
 void updateSource(java.lang.StackTraceElement stackTraceElement)
          Records stack trace information and count where timing is initiated.
 
Methods inherited from class org.sormula.operation.monitor.OperationTime
format, getDescription, getExecuteTime, getPrepareTime, getReadTime, getTimingId, getTotalTime, getWriteTime, logTimings, setDescription, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoOperationTime

public NoOperationTime()
Method Detail

startPrepareTime

public void startPrepareTime()
Description copied from class: OperationTime
Starts recording prepare time. Use OperationTime.stop() to stop recording.

Overrides:
startPrepareTime in class OperationTime

startWriteTime

public void startWriteTime()
Description copied from class: OperationTime
Starts recording write time. Use OperationTime.stop() to stop recording.

Overrides:
startWriteTime in class OperationTime

startExecuteTime

public void startExecuteTime()
Description copied from class: OperationTime
Starts recording execute time. Use OperationTime.stop() to stop recording.

Overrides:
startExecuteTime in class OperationTime

startReadTime

public void startReadTime()
Description copied from class: OperationTime
Starts recording read time. Use OperationTime.stop() to stop recording.

Overrides:
startReadTime in class OperationTime

stop

public void stop()
Description copied from class: OperationTime
Stops recording the active time that was started with one of the start methods. The total pause time is subtracted from total time between start/stop.

Overrides:
stop in class OperationTime

cancel

public void cancel()
Description copied from class: OperationTime
Cancels recording active time.

Overrides:
cancel in class OperationTime

pause

public void pause()
Description copied from class: OperationTime
Stops recording the currently active time until OperationTime.resume() is invoked. Zero or more pause/resume pairs may be invoked.

Overrides:
pause in class OperationTime

resume

public void resume()
Description copied from class: OperationTime
Starts recording the active time that was paused.

Overrides:
resume in class OperationTime

updateSource

public void updateSource(java.lang.StackTraceElement stackTraceElement)
Description copied from class: OperationTime
Records stack trace information and count where timing is initiated. Parent operation time is updated also.

Overrides:
updateSource in class OperationTime
Parameters:
stackTraceElement - the location on the stack where operation was initiated