twitter4j.management
Class APIStatistics
java.lang.Object
twitter4j.management.APIStatistics
- All Implemented Interfaces:
- APIStatisticsMBean, InvocationStatistics
public class APIStatistics
- extends java.lang.Object
- implements APIStatisticsMBean
Container for all InvocationStatisticsCalculators in a given API (like Twitter)
- Author:
- Nick Dellamaggiore (nick.dellamaggiore gmail.com)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
API_STATS_CALCULATOR
private final InvocationStatisticsCalculator API_STATS_CALCULATOR
METHOD_STATS_MAP
private final java.util.Map<java.lang.String,InvocationStatisticsCalculator> METHOD_STATS_MAP
HISTORY_SIZE
private final int HISTORY_SIZE
APIStatistics
public APIStatistics(int historySize)
- Parameters:
historySize
- the number of calls to track (for invocation time averaging)
methodCalled
public void methodCalled(java.lang.String method,
long time,
boolean success)
- Parameters:
method
- the method invokedtime
- the method execution time
getMethodStatistics
private InvocationStatisticsCalculator getMethodStatistics(java.lang.String method)
getInvocationStatistics
public java.lang.Iterable<? extends InvocationStatistics> getInvocationStatistics()
- Specified by:
getInvocationStatistics
in interface APIStatisticsMBean
reset
public void reset()
- Specified by:
reset
in interface InvocationStatistics
getName
public java.lang.String getName()
- APIStatisticsMBean implementation
- Specified by:
getName
in interface InvocationStatistics
getCallCount
public long getCallCount()
- Specified by:
getCallCount
in interface InvocationStatistics
getErrorCount
public long getErrorCount()
- Specified by:
getErrorCount
in interface InvocationStatistics
getTotalTime
public long getTotalTime()
- Specified by:
getTotalTime
in interface InvocationStatistics
getAverageTime
public long getAverageTime()
- Specified by:
getAverageTime
in interface InvocationStatistics
getMethodLevelSummariesAsString
public java.util.Map<java.lang.String,java.lang.String> getMethodLevelSummariesAsString()
- Specified by:
getMethodLevelSummariesAsString
in interface APIStatisticsMBean
getMethodLevelSummary
public java.lang.String getMethodLevelSummary(java.lang.String methodName)
- Specified by:
getMethodLevelSummary
in interface APIStatisticsMBean