Package org.opensextant.extraction
Class ExtractionMetrics
java.lang.Object
org.opensextant.extraction.ExtractionMetrics
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBytes(long delta) voidaddTime(long delta) Add just a time delta.voidaddTime(long delta, int calls) Add just a time delta.voidaddTimeSince(long epoch) Add time delta using NOW - time.intavg time spent for this metric in millisecondslongintlongvoidsetByteCount(long c) toString()
-
Constructor Details
-
ExtractionMetrics
A named metric- Parameters:
nm- name of metric
-
-
Method Details
-
toString
-
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 spancalls- 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)
-