Class Metric

java.lang.Object
gda.px.metrics.Metric

public class Metric extends Object
  • Method Details

    • createUnstarted

      public static Metric createUnstarted(String name)
      Create a new Metric in an unstarted state, i.e. its {#link start() method will need to be called for it to start timing an action.
      Parameters:
      name - name of the metric
    • createStarted

      public static Metric createStarted(String name)
      Create a new Metric in a started state.
      Parameters:
      name - name of the metric
    • start

      public void start()
      Starts timing an action.
    • stop

      public void stop()
      Stops timing an action.
    • elapsed

      public long elapsed(TimeUnit unit)
      Returns the elapsed time, in the specified unit.
      Returns:
      elapsed time
    • log

      public void log()
      Logs the recorded time for the action.