com.endeca.portal.instrumentation.metrics
Class GenericMetric

java.lang.Object
  extended by com.endeca.portal.instrumentation.metrics.GenericMetric
All Implemented Interfaces:
Metric
Direct Known Subclasses:
PortletMetric, QueryMetric

public abstract class GenericMetric
extends java.lang.Object
implements Metric

abstract generic implementation of a metric to be tracked for performance reasons

Author:
dan

Constructor Summary
GenericMetric()
           
 
Method Summary
 void addSingleExecution(long ms)
          adds a single component execution to the count and total time of executions
 long getAverageExecutionTime()
          Returns the dumb average (totalExecutionTime/numExecutions) execution time for this query type.
 long getMaxTime()
          get the maximum time spent on a single query
 long getTotalCount()
          get the total number of times this type of query executed
 long getTotalTime()
          get the total time spent for all queries of this type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.endeca.portal.instrumentation.metrics.Metric
toJSONObject
 

Constructor Detail

GenericMetric

public GenericMetric()
Method Detail

addSingleExecution

public void addSingleExecution(long ms)
adds a single component execution to the count and total time of executions

Specified by:
addSingleExecution in interface Metric
Parameters:
ms - the amount of time to add

getAverageExecutionTime

public long getAverageExecutionTime()
Description copied from interface: Metric
Returns the dumb average (totalExecutionTime/numExecutions) execution time for this query type.

Specified by:
getAverageExecutionTime in interface Metric
Returns:
the average execution time

getTotalCount

public long getTotalCount()
Description copied from interface: Metric
get the total number of times this type of query executed

Specified by:
getTotalCount in interface Metric
Returns:
the total count

getTotalTime

public long getTotalTime()
Description copied from interface: Metric
get the total time spent for all queries of this type

Specified by:
getTotalTime in interface Metric
Returns:
the total time

getMaxTime

public long getMaxTime()
Description copied from interface: Metric
get the maximum time spent on a single query

Specified by:
getMaxTime in interface Metric
Returns:
the max query time