Class ExtractionMetrics

java.lang.Object
org.opensextant.extraction.ExtractionMetrics

public class ExtractionMetrics extends Object
This is a holder for tracking various common measures: No. of Calls, Amount of time, No. of bytes Delta quantities (addBytes, addTime, addTimeSince), etc. cannot represent negative quantities.
Author:
ubaldino
  • Constructor Details

    • ExtractionMetrics

      public ExtractionMetrics(String nm)
      A named metric
      Parameters:
      nm - name of metric
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getAverageTime

      public int getAverageTime()
      avg time spent for this metric in milliseconds
      Returns:
      average time
    • addTime

      public void addTime(long delta)
      Add just a time delta.
      Parameters:
      delta - milliseconds span
    • addTimeSince

      public void addTimeSince(long epoch)
      Add time delta using NOW - time.
      Parameters:
      epoch - milliseconds epoch
    • addTime

      public void addTime(long delta, int calls)
      Add just a time delta.
      Parameters:
      delta - milliseconds span
      calls - number of calls for this metric that occured over delta
    • getTotalTime

      public long getTotalTime()
    • getCallCount

      public int getCallCount()
    • addBytes

      public void addBytes(long delta)
    • getByteCount

      public long getByteCount()
    • setByteCount

      public void setByteCount(long c)