public class InvocationStatisticsCalculator extends java.lang.Object implements InvocationStatistics
Modifier and Type | Field and Description |
---|---|
private long |
callCount |
private long |
errorCount |
private int |
index |
private java.lang.String |
name |
private long[] |
times |
private long |
totalTime |
Constructor and Description |
---|
InvocationStatisticsCalculator(java.lang.String name,
int historySize) |
Modifier and Type | Method and Description |
---|---|
long |
getAverageTime() |
long |
getCallCount() |
long |
getErrorCount() |
java.lang.String |
getName() |
long |
getTotalTime() |
(package private) void |
increment(long time,
boolean success) |
void |
reset() |
java.lang.String |
toString() |
private java.lang.String name
private long[] times
private int index
private long callCount
private long errorCount
private long totalTime
public InvocationStatisticsCalculator(java.lang.String name, int historySize)
name
- the name of this API methodhistorySize
- the number of calls to track (for invocation time averaging)void increment(long time, boolean success)
public java.lang.String getName()
getName
in interface InvocationStatistics
public long getCallCount()
getCallCount
in interface InvocationStatistics
public long getErrorCount()
getErrorCount
in interface InvocationStatistics
public long getTotalTime()
getTotalTime
in interface InvocationStatistics
public long getAverageTime()
getAverageTime
in interface InvocationStatistics
public void reset()
reset
in interface InvocationStatistics
public java.lang.String toString()
toString
in class java.lang.Object