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)
ProfilerProvider
ProfileLevel.Info
level.start
in interface ProfilerProvider
rootName
- 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)
ProfilerProvider
ProfileLevel.Info
level.start
in interface ProfilerProvider
id
- 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)
ProfilerProvider
start
in interface ProfilerProvider
rootName
- 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)
ProfilerProvider
start
in interface ProfilerProvider
id
- 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)
ProfilerProvider
Generally 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 ProfilerProvider
discardResults
- 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)
ProfilerProvider
ProfilerImpl.stop()
method. End users do not need to call it. Only public so that
custom ProfilerProviders can be developed.stopSession
in interface ProfilerProvider
profilingSession
- 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()
ProfilerProvider
This 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 ProfilerProvider
public Profiler getCurrent()
ProfilerProvider
ProfilerProvider.current()
.getCurrent
in interface ProfilerProvider
public boolean hasCurrent()
ProfilerProvider
hasCurrent
in interface ProfilerProvider
public Storage getStorage()
ProfilerProvider
Storage
associated with this provider.getStorage
in interface ProfilerProvider
public void setStorage(Storage storage)
ProfilerProvider
Storage
for this provider to use.setStorage
in interface ProfilerProvider
storage
- the storage to usepublic ProfilerUiConfig getUiConfig()
ProfilerProvider
ProfilerUiConfig
associated with this provider.getUiConfig
in interface ProfilerProvider
public void setUiConfig(ProfilerUiConfig uiConfig)
ProfilerProvider
ProfilerUiConfig
for this provider to use.setUiConfig
in interface ProfilerProvider
uiConfig
- the UI config to use