com.endeca.portal.instrumentation.metrics
Interface Metric

All Known Implementing Classes:
GenericMetric, PortletMetric, QueryMetric

public interface Metric

Interface representing a metric to be tracked for performance reasons

Author:
dan

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
 org.json.JSONObject toJSONObject()
          turns the metric information into a JSON object; useful for serialization
 

Method Detail

getAverageExecutionTime

long getAverageExecutionTime()
Returns the dumb average (totalExecutionTime/numExecutions) execution time for this query type.

Returns:
the average execution time

getTotalCount

long getTotalCount()
get the total number of times this type of query executed

Returns:
the total count

getTotalTime

long getTotalTime()
get the total time spent for all queries of this type

Returns:
the total time

getMaxTime

long getMaxTime()
get the maximum time spent on a single query

Returns:
the max query time

addSingleExecution

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

Parameters:
ms - the amount of time to add

toJSONObject

org.json.JSONObject toJSONObject()
                                 throws org.json.JSONException
turns the metric information into a JSON object; useful for serialization

Returns:
the JSON object representing the metric
Throws:
org.json.JSONException