twitter4j.management
Class InvocationStatisticsCalculator
java.lang.Object
twitter4j.management.InvocationStatisticsCalculator
- All Implemented Interfaces:
- InvocationStatistics
public class InvocationStatisticsCalculator
- extends java.lang.Object
- implements InvocationStatistics
Object that collects/aggregates statistics for the invocation of a given method.
- Author:
- Nick Dellamaggiore (nick.dellamaggiore gmail.com)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
name
private java.lang.String name
times
private long[] times
index
private int index
callCount
private long callCount
errorCount
private long errorCount
totalTime
private long totalTime
InvocationStatisticsCalculator
public InvocationStatisticsCalculator(java.lang.String name,
int historySize)
- Parameters:
name
- the name of this API methodhistorySize
- the number of calls to track (for invocation time averaging)
increment
public void increment(long time,
boolean success)
getName
public java.lang.String getName()
- 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
reset
public void reset()
- Specified by:
reset
in interface InvocationStatistics
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object