com.endeca.portal.instrumentation.metrics
Class QueryMetric

java.lang.Object
  extended by com.endeca.portal.instrumentation.metrics.GenericMetric
      extended by com.endeca.portal.instrumentation.metrics.QueryMetric
All Implemented Interfaces:
Metric

public class QueryMetric
extends GenericMetric
implements Metric

Bean representing the aggregate performance of datastore queries, tracking the number of queries, the total time spent querying, and the longest query

Author:
dan

Constructor Summary
QueryMetric(java.lang.String queryTypeName)
          Create a new QueryMetric for this query type.
 
Method Summary
 void addSingleQuery(com.endeca.navigation.ENEQuery query, com.endeca.navigation.ENEQueryResults results, long ms)
          adds a single query execution to the count and total time of queries
 void addSingleQuery(com.endeca.mdex.conversation.Request query, com.endeca.mdex.conversation.Results results, long ms)
          adds a single discovery service query execution to the count and total time of queries
 java.lang.String getQueryTypeName()
          Gets the name of the query type this object is tracking
 org.json.JSONObject toJSONObject()
          Serializes this object into a JSON string
 
Methods inherited from class com.endeca.portal.instrumentation.metrics.GenericMetric
addSingleExecution, getAverageExecutionTime, getMaxTime, getTotalCount, getTotalTime
 
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
addSingleExecution, getAverageExecutionTime, getMaxTime, getTotalCount, getTotalTime
 

Constructor Detail

QueryMetric

public QueryMetric(java.lang.String queryTypeName)
Create a new QueryMetric for this query type.

Parameters:
queryTypeName -
Method Detail

addSingleQuery

public void addSingleQuery(com.endeca.navigation.ENEQuery query,
                           com.endeca.navigation.ENEQueryResults results,
                           long ms)
adds a single query execution to the count and total time of queries

Parameters:
query - the query that executed
results - the results of the query
ms - the amount of time to add

addSingleQuery

public void addSingleQuery(com.endeca.mdex.conversation.Request query,
                           com.endeca.mdex.conversation.Results results,
                           long ms)
adds a single discovery service query execution to the count and total time of queries

Parameters:
query - the query that executed
results - the results of the query
ms - the amount of time to add

toJSONObject

public org.json.JSONObject toJSONObject()
                                 throws org.json.JSONException
Serializes this object into a JSON string

Specified by:
toJSONObject in interface Metric
Returns:
the JSONObject representing this object
Throws:
org.json.JSONException

getQueryTypeName

public java.lang.String getQueryTypeName()
Gets the name of the query type this object is tracking

Returns:
the query type