twitter4j.management

## Class APIStatistics

- java.lang.Object
- - twitter4j.management.APIStatistics

All Implemented Interfaces:
  APIStatisticsMBean, InvocationStatistics

    public class APIStatistics
    extends Object
    implements APIStatisticsMBean

Container for all InvocationStatisticsCalculators in a given API (like Twitter)

Author:
  Nick Dellamaggiore (nick.dellamaggiore at gmail.com)

### Constructor Summary

Constructors
Constructor and Description
`APIStatistics(int historySize)`

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `getAverageTime()`
`long` `getCallCount()`
`long` `getErrorCount()`
`Iterable<? extends InvocationStatistics>` `getInvocationStatistics()`
`Map<String,String>` `getMethodLevelSummariesAsString()`
`String` `getMethodLevelSummary(String methodName)`
`String` `getName()` APIStatisticsMBean implementation
`long` `getTotalTime()`
`void` `methodCalled(String method, long time, boolean success)`
`void` `reset()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### APIStatistics

    public APIStatistics(int historySize)

Parameters:
  `historySize` - the number of calls to track (for invocation time averaging)

### Method Detail

#### methodCalled

    public void methodCalled(String method,
                             long time,
                             boolean success)

Parameters:
  `method` - the method invoked
  `time` - the method execution time
  `success` - success

#### getInvocationStatistics

    public Iterable<? extends InvocationStatistics> getInvocationStatistics()

Specified by:
  `getInvocationStatistics` in interface `APIStatisticsMBean`

#### reset

    public void reset()

Specified by:
  `reset` in interface `InvocationStatistics`

#### getName

    public 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 Map<String,String> getMethodLevelSummariesAsString()

Specified by:
  `getMethodLevelSummariesAsString` in interface `APIStatisticsMBean`

#### getMethodLevelSummary

    public String getMethodLevelSummary(String methodName)

Specified by:
  `getMethodLevelSummary` in interface `APIStatisticsMBean`