com.endeca.portal.instrumentation
Class Profiler

java.lang.Object
  extended by com.endeca.portal.instrumentation.Profiler

public class Profiler
extends java.lang.Object

The Profiler class encapsulates and provides a central point for other classes to hook into performance instrumentation for recording datapoints

Author:
dan

Method Summary
static long end(ProfilerType type, RequestTracker requestTracker, javax.portlet.GenericPortlet portlet, javax.portlet.PortletMode mode, javax.portlet.WindowState windowState, long startTime)
          Convenience method for recording portlet executions only.
static long end(ProfilerType type, RequestTracker requestTracker, java.lang.String dataSourceName, com.endeca.navigation.ENEQuery query, com.endeca.navigation.ENEQueryResults results, long startTime)
          Method to record MDEX queries, whether cached or uncached.
static long end(ProfilerType type, RequestTracker requestTracker, java.lang.String dataSourceName, com.endeca.mdex.conversation.Request query, com.endeca.mdex.conversation.Results results, long startTime)
          Method to record discovery service queries, whether cached or uncached.
static long start()
          Call this method just before the code you want to profile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

start

public static long start()
Call this method just before the code you want to profile. It returns the time in ms that you'll need to pass in to one of the end() methods to get the overall elapsed time.

Returns:
the current time, in milliseconds.

end

public static long end(ProfilerType type,
                       RequestTracker requestTracker,
                       javax.portlet.GenericPortlet portlet,
                       javax.portlet.PortletMode mode,
                       javax.portlet.WindowState windowState,
                       long startTime)
Convenience method for recording portlet executions only. Call this method just after the code you want to profile.

Parameters:
type - the only valid value is ProfilerType.PORTLET_EXECUTION
portlet - the portlet being profiled
mode - the mode of the portlet execution being profiled
startTime - the time, in ms, that the profiling started
Returns:
the elapsed time, in ms, of the profiled code

end

public static long end(ProfilerType type,
                       RequestTracker requestTracker,
                       java.lang.String dataSourceName,
                       com.endeca.navigation.ENEQuery query,
                       com.endeca.navigation.ENEQueryResults results,
                       long startTime)
Method to record MDEX queries, whether cached or uncached. Call this method just after the code you want to profile.

Parameters:
type - valid values are ProfilerType.MDEX_QUERY_ENGINE and ProfilerType.MDEX_QUERY_CACHED
dataSourceName - the datasource for the query being profiled
query - the query sent to the MDEX
results - the results from the MDEX
startTime - the time, in ms, that the profiling started
Returns:
the elapsed time, in ms, of the profiled code

end

public static long end(ProfilerType type,
                       RequestTracker requestTracker,
                       java.lang.String dataSourceName,
                       com.endeca.mdex.conversation.Request query,
                       com.endeca.mdex.conversation.Results results,
                       long startTime)
Method to record discovery service queries, whether cached or uncached. Call this method just after the code you want to profile.

Parameters:
type - valid values are ProfilerType.MDEX_QUERY_ENGINE and ProfilerType.MDEX_QUERY_CACHED
dataSourceName - the datasource for the query being profiled
query - the query sent to the MDEX
results - the results from the MDEX
startTime - the time, in ms, that the profiling started
Returns:
the elapsed time, in ms, of the profiled code