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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
avg time spent for this metric in millisecondslong
int
long
void
setByteCount
(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)
-