com.endeca.portal.instrumentation
Class DataSourceTracker

java.lang.Object
  extended by com.endeca.portal.instrumentation.DataSourceTracker
All Implemented Interfaces:
DataSourceInstrumentor

public class DataSourceTracker
extends java.lang.Object
implements DataSourceInstrumentor

Concrete class to track all query executions, both at a global level and at a per-datasource level

Author:
dan

Method Summary
 void addCachedDataQuery(RequestTracker requestTracker, java.lang.String dataSourceString, com.endeca.navigation.ENEQuery query, com.endeca.navigation.ENEQueryResults results, long ms)
          Tracks a single query to an MDEX DataSource that was satisfied by application cache
 void addCachedDataQuery(RequestTracker requestTracker, java.lang.String dataSourceString, com.endeca.mdex.conversation.Request query, com.endeca.mdex.conversation.Results results, long ms)
           
 void addDataQuery(RequestTracker requestTracker, java.lang.String dataSourceString, com.endeca.navigation.ENEQuery query, com.endeca.navigation.ENEQueryResults results, long ms)
          Tracks a single uncached query to an MDEX DataSource
 void addDataQuery(RequestTracker requestTracker, java.lang.String dataSourceString, com.endeca.mdex.conversation.Request query, com.endeca.mdex.conversation.Results results, long ms)
           
protected  java.lang.Object clone()
           
 java.util.Set<java.lang.String> getDataSourceKeys()
          Returns the set of all DataSource keys being tracked
 MDEXMetric getGlobalMetric()
          Returns the metric representing all query executions, lumped together
protected static DataSourceTracker getInstance()
           
 MDEXMetric getMetric(java.lang.String key)
          Returns the metric representing only the executions of a specified DataSource
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

protected static DataSourceTracker getInstance()

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getGlobalMetric

public MDEXMetric getGlobalMetric()
Returns the metric representing all query executions, lumped together

Returns:
the global metric

getMetric

public MDEXMetric getMetric(java.lang.String key)
Returns the metric representing only the executions of a specified DataSource

Parameters:
key - the key for the DataSource, typically the DataSource description
Returns:
the DataSource's metric

getDataSourceKeys

public java.util.Set<java.lang.String> getDataSourceKeys()
Returns the set of all DataSource keys being tracked

Returns:
the set of all DataSource keys being tracked

addCachedDataQuery

public void addCachedDataQuery(RequestTracker requestTracker,
                               java.lang.String dataSourceString,
                               com.endeca.navigation.ENEQuery query,
                               com.endeca.navigation.ENEQueryResults results,
                               long ms)
Description copied from interface: DataSourceInstrumentor
Tracks a single query to an MDEX DataSource that was satisfied by application cache

Specified by:
addCachedDataQuery in interface DataSourceInstrumentor
dataSourceString - the key/description of the DataSource
query - The query object that executed
results - The results of the query that executed
ms - The execution time of the query

addDataQuery

public void addDataQuery(RequestTracker requestTracker,
                         java.lang.String dataSourceString,
                         com.endeca.navigation.ENEQuery query,
                         com.endeca.navigation.ENEQueryResults results,
                         long ms)
Description copied from interface: DataSourceInstrumentor
Tracks a single uncached query to an MDEX DataSource

Specified by:
addDataQuery in interface DataSourceInstrumentor
dataSourceString - the key/description of the DataSource
query - The query object that executed
results - The results of the query that executed
ms - The execution time of the query

addCachedDataQuery

public void addCachedDataQuery(RequestTracker requestTracker,
                               java.lang.String dataSourceString,
                               com.endeca.mdex.conversation.Request query,
                               com.endeca.mdex.conversation.Results results,
                               long ms)

addDataQuery

public void addDataQuery(RequestTracker requestTracker,
                         java.lang.String dataSourceString,
                         com.endeca.mdex.conversation.Request query,
                         com.endeca.mdex.conversation.Results results,
                         long ms)