public class APIStatistics extends java.lang.Object implements APIStatisticsMBean
Modifier and Type | Field and Description |
---|---|
private InvocationStatisticsCalculator |
API_STATS_CALCULATOR |
private int |
HISTORY_SIZE |
private java.util.Map<java.lang.String,InvocationStatisticsCalculator> |
METHOD_STATS_MAP |
Constructor and Description |
---|
APIStatistics(int historySize) |
Modifier and Type | Method and Description |
---|---|
long |
getAverageTime() |
long |
getCallCount() |
long |
getErrorCount() |
java.lang.Iterable<? extends InvocationStatistics> |
getInvocationStatistics() |
java.util.Map<java.lang.String,java.lang.String> |
getMethodLevelSummariesAsString() |
java.lang.String |
getMethodLevelSummary(java.lang.String methodName) |
private InvocationStatisticsCalculator |
getMethodStatistics(java.lang.String method) |
java.lang.String |
getName()
APIStatisticsMBean implementation
|
long |
getTotalTime() |
void |
methodCalled(java.lang.String method,
long time,
boolean success) |
void |
reset() |
private final InvocationStatisticsCalculator API_STATS_CALCULATOR
private final java.util.Map<java.lang.String,InvocationStatisticsCalculator> METHOD_STATS_MAP
private final int HISTORY_SIZE
public APIStatistics(int historySize)
historySize
- the number of calls to track (for invocation time averaging)public void methodCalled(java.lang.String method, long time, boolean success)
method
- the method invokedtime
- the method execution timeprivate InvocationStatisticsCalculator getMethodStatistics(java.lang.String method)
public java.lang.Iterable<? extends InvocationStatistics> getInvocationStatistics()
getInvocationStatistics
in interface APIStatisticsMBean
public void reset()
reset
in interface InvocationStatistics
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 java.util.Map<java.lang.String,java.lang.String> getMethodLevelSummariesAsString()
getMethodLevelSummariesAsString
in interface APIStatisticsMBean
public java.lang.String getMethodLevelSummary(java.lang.String methodName)
getMethodLevelSummary
in interface APIStatisticsMBean