public abstract class DelegatingProfilerProvider extends java.lang.Object implements ProfilerProvider
| Constructor and Description |
|---|
DelegatingProfilerProvider() |
| Modifier and Type | Method and Description |
|---|---|
Profiler |
current()
Returns the current MiniProfiler.
|
Profiler |
getCurrent()
A properties-friendly version of
ProfilerProvider.current(). |
protected abstract ProfilerProvider |
getDelegate() |
Storage |
getStorage()
Returns the
Storage associated with this provider. |
ProfilerUiConfig |
getUiConfig()
Returns the
ProfilerUiConfig associated with this provider. |
boolean |
hasCurrent()
Return true if there is a current profiler.
|
void |
setStorage(Storage storage)
Sets the
Storage for this provider to use. |
void |
setUiConfig(ProfilerUiConfig uiConfig)
Sets the
ProfilerUiConfig for this provider to use. |
Profiler |
start(java.lang.String rootName)
Start a new profiling session with the default
ProfileLevel.Info level. |
Profiler |
start(java.lang.String rootName,
ProfileLevel level)
Start a new profiling session with the given level.
|
Profiler |
start(java.util.UUID id,
java.lang.String rootName)
Start a new profiling session with the default
ProfileLevel.Info level. |
Profiler |
start(java.util.UUID id,
java.lang.String rootName,
ProfileLevel level)
Start a new profiling session with the given level, root name and UUID.
|
void |
stopCurrentSession(boolean discardResults)
Ends the current profiling session, if one exists.
|
void |
stopSession(ProfilerImpl profilingSession,
boolean discardResults)
Marks the given profiling session as stopped.
|
protected abstract ProfilerProvider getDelegate()
public Profiler start(java.lang.String rootName)
ProfilerProviderProfileLevel.Info level.start in interface ProfilerProviderrootName - the name of the root timing step. This might often be the uri of the current request.public Profiler start(java.util.UUID id, java.lang.String rootName)
ProfilerProviderProfileLevel.Info level.start in interface ProfilerProviderid - the UUID to userootName - the name of the root timing step. This might often be the uri of the current request.public Profiler start(java.lang.String rootName, ProfileLevel level)
ProfilerProviderstart in interface ProfilerProviderrootName - the name of the root timing step. This might often be the uri of the current request.level - the level of the profiling sessionpublic Profiler start(java.util.UUID id, java.lang.String rootName, ProfileLevel level)
ProfilerProviderstart in interface ProfilerProviderid - the UUID to userootName - the name of the root timing step. This might often be the uri of the current request.level - the level of the profiling sessionpublic void stopCurrentSession(boolean discardResults)
ProfilerProviderGenerally it is preferrable to stop a profiling session by
calling Profiler.stop(), but in some circumstances
it may be easier to call this method.
stopCurrentSession in interface ProfilerProviderdiscardResults - When true, clears the miniprofiler for this request, allowing profiling to
be prematurely stopped and discarded. Useful for when a specific route does not need to be profiled.public void stopSession(ProfilerImpl profilingSession, boolean discardResults)
ProfilerProviderProfilerImpl.stop()
method. End users do not need to call it. Only public so that
custom ProfilerProviders can be developed.stopSession in interface ProfilerProviderprofilingSession - the profiler to register as stoppeddiscardResults - When true, clears the miniprofiler for this request, allowing profiling to
be prematurely stopped and discarded. Useful for when a specific route does not need to be profiled.public Profiler current()
ProfilerProviderThis method should never return null. If there is no current profiling session,
a NullProfiler instance will be returned so that calling code does not
have to do null checks around every timing block.
current in interface ProfilerProviderpublic Profiler getCurrent()
ProfilerProviderProfilerProvider.current().getCurrent in interface ProfilerProviderpublic boolean hasCurrent()
ProfilerProviderhasCurrent in interface ProfilerProviderpublic Storage getStorage()
ProfilerProviderStorage associated with this provider.getStorage in interface ProfilerProviderpublic void setStorage(Storage storage)
ProfilerProviderStorage for this provider to use.setStorage in interface ProfilerProviderstorage - the storage to usepublic ProfilerUiConfig getUiConfig()
ProfilerProviderProfilerUiConfig associated with this provider.getUiConfig in interface ProfilerProviderpublic void setUiConfig(ProfilerUiConfig uiConfig)
ProfilerProviderProfilerUiConfig for this provider to use.setUiConfig in interface ProfilerProvideruiConfig - the UI config to use