net.sf.infrared.agent
Class Statistics

java.lang.Object
  extended bynet.sf.infrared.agent.Statistics
All Implemented Interfaces:
Serializable

public class Statistics
extends Object
implements Serializable

This class is used to keep track of the performance metrics that are collected. An instance of Statistics object is held in a static map in the StatisticMgr. StatisticsCollector also holds a private instance of this class to collect statistics for each operation in the request. StatisticsCollector then merges this instance of Statistics object with the statistics object held by StatisticsMgr. The aggregation of Statistics collected by StatisticsCollector with the StatisticsManager happens based on the collection strategy viz Local and Remote.

See Also:
Serialized Form

Constructor Summary
Statistics(String applicationName, String instanceId)
           
 
Method Summary
 AggregateOperationTree createAggregateOperationTree()
           
 AggregateOperationTree getAggregateOperationTree()
           
 String getApplicationName()
           
 AggregateApiTime[] getCopyOfApiTimes()
           
 AggregateApiTime getCopyOfHttpResponseTime()
           
 AggregateOperationTree[] getCopyOfLastInovations()
           
 LayerTime[] getCopyOfLayerTimes()
           
 AggregateApiTime getHttpResponseSummary()
           
 String getInstanceId()
           
 JDBCStatisticRepository getJDBCStatisticsRepository()
           
 boolean hasStatistics()
           
 void merge(Statistics other)
          Merge the data from another other statistics object with this
 void reset()
           
 void updateApiStatistics(String apiName, String apiType, long time, long exclusiveTime)
          Update the performance statistics with the timing information of an API.
 void updateHTTPStatistics(String request, long execTime)
           
 void updateLayerStatistics(Map layerTimings)
           
 void updateOperationStatistics(OperationTree operation)
          Update the performance statistics with the timing information of an operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Statistics

public Statistics(String applicationName,
                  String instanceId)
Method Detail

updateApiStatistics

public void updateApiStatistics(String apiName,
                                String apiType,
                                long time,
                                long exclusiveTime)
Update the performance statistics with the timing information of an API.

Parameters:
apiName -
apiType -
time -

updateOperationStatistics

public void updateOperationStatistics(OperationTree operation)
Update the performance statistics with the timing information of an operation.

Parameters:
operation -

getCopyOfApiTimes

public AggregateApiTime[] getCopyOfApiTimes()

getAggregateOperationTree

public AggregateOperationTree getAggregateOperationTree()

getCopyOfLayerTimes

public LayerTime[] getCopyOfLayerTimes()

getCopyOfLastInovations

public AggregateOperationTree[] getCopyOfLastInovations()

getCopyOfHttpResponseTime

public AggregateApiTime getCopyOfHttpResponseTime()

createAggregateOperationTree

public AggregateOperationTree createAggregateOperationTree()

reset

public void reset()

updateLayerStatistics

public void updateLayerStatistics(Map layerTimings)

updateHTTPStatistics

public void updateHTTPStatistics(String request,
                                 long execTime)

getHttpResponseSummary

public AggregateApiTime getHttpResponseSummary()

getJDBCStatisticsRepository

public JDBCStatisticRepository getJDBCStatisticsRepository()

merge

public void merge(Statistics other)
Merge the data from another other statistics object with this

Parameters:
other -

getApplicationName

public String getApplicationName()

getInstanceId

public String getInstanceId()

hasStatistics

public boolean hasStatistics()