facebook4j.management
Class InvocationStatisticsCalculator

java.lang.Object
  extended by facebook4j.management.InvocationStatisticsCalculator
All Implemented Interfaces:
InvocationStatistics

public class InvocationStatisticsCalculator
extends Object
implements InvocationStatistics

Object that collects/aggregates statistics for the invocation of a given method.

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

Constructor Summary
InvocationStatisticsCalculator(String name, int historySize)
           
 
Method Summary
 long getAverageTime()
           
 long getCallCount()
           
 long getErrorCount()
           
 String getName()
           
 long getTotalTime()
           
 void increment(long time, boolean success)
           
 void reset()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvocationStatisticsCalculator

public InvocationStatisticsCalculator(String name,
                                      int historySize)
Parameters:
name - the name of this API method
historySize - the number of calls to track (for invocation time averaging)
Method Detail

increment

public void increment(long time,
                      boolean success)

getName

public 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 String toString()
Overrides:
toString in class Object


Copyright © 2019. All rights reserved.