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 APIStatisticsMBeanpublic void reset()
reset in interface InvocationStatisticspublic java.lang.String getName()
getName in interface InvocationStatisticspublic long getCallCount()
getCallCount in interface InvocationStatisticspublic long getErrorCount()
getErrorCount in interface InvocationStatisticspublic long getTotalTime()
getTotalTime in interface InvocationStatisticspublic long getAverageTime()
getAverageTime in interface InvocationStatisticspublic java.util.Map<java.lang.String,java.lang.String> getMethodLevelSummariesAsString()
getMethodLevelSummariesAsString in interface APIStatisticsMBeanpublic java.lang.String getMethodLevelSummary(java.lang.String methodName)
getMethodLevelSummary in interface APIStatisticsMBean