org.apache.oozie.util
Class Instrumentation.Cron

java.lang.Object
  extended by org.apache.oozie.util.Instrumentation.Cron
Enclosing class:
Instrumentation

public static class Instrumentation.Cron
extends Object

Cron is a stopwatch that can be started/stopped several times.

This class is not thread safe, it does not need to be.

It keeps track of the total time (first start to last stop) and the running time (total time minus the stopped intervals).

Once a Cron is complete it must be added to the corresponding group/name in a Instrumentation instance.


Constructor Summary
Instrumentation.Cron()
          Creates new Cron, stopped, in zero.
 
Method Summary
 long getEnd()
          Return the end time of the cron.
 long getOwn()
          Return the own time of the cron.
 long getStart()
          Return the start time of the cron.
 long getTotal()
          Return the total time of the cron.
 void start()
          Start the cron.
 void stop()
          Stops the cron.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Instrumentation.Cron

public Instrumentation.Cron()
Creates new Cron, stopped, in zero.

Method Detail

start

public void start()
Start the cron. It cannot be already started.


stop

public void stop()
Stops the cron. It cannot be already stopped.


getStart

public long getStart()
Return the start time of the cron. It must be stopped.

Returns:
the start time of the cron.

getEnd

public long getEnd()
Return the end time of the cron. It must be stopped.

Returns:
the end time of the cron.

getTotal

public long getTotal()
Return the total time of the cron. It must be stopped.

Returns:
the total time of the cron.

getOwn

public long getOwn()
Return the own time of the cron. It must be stopped.

Returns:
the own time of the cron.


Copyright © 2013 Apache Software Foundation. All Rights Reserved.