Class ExtractionMetrics


  • public class ExtractionMetrics
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      ExtractionMetrics​(java.lang.String nm)
      A named metric
    • Method Summary

      Modifier and Type Method Description
      void addBytes​(long delta)  
      void addTime​(long delta)
      Add just a time delta.
      void addTime​(long delta, int calls)
      Add just a time delta.
      void addTimeSince​(long epoch)
      Add time delta using NOW - time.
      int getAverageTime()
      avg time spent for this metric in milliseconds
      long getByteCount()  
      int getCallCount()  
      long getTotalTime()  
      void setByteCount​(long c)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ExtractionMetrics

        public ExtractionMetrics​(java.lang.String nm)
        A named metric
        Parameters:
        nm - name of metric
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.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)