public class RatpackContextProfilerProvider extends BaseProfilerProvider
ProfilerProvider
that keeps profilers that it creates on the current Ratpack
Execution
rather than e.g. a ThreadLocal
, since Ratpack executions span across multiple
threads.Constructor and Description |
---|
RatpackContextProfilerProvider() |
Modifier and Type | Method and Description |
---|---|
protected Profiler |
lookupCurrentProfiler()
Grabs the current profiler from the current execution.
|
protected void |
profilerCreated(Profiler profiler)
Adds the given rofiler to the current
Execution . |
protected void |
profilerStopped(Profiler profiler)
Does nothing.
|
current, getCurrent, getDefaultHostname, getMachineName, getStorage, getUiConfig, hasCurrent, setMachineName, setStorage, setUiConfig, setUserProvider, start, start, start, start, stopCurrentSession, stopSession
protected void profilerCreated(Profiler profiler)
Execution
.profilerCreated
in class BaseProfilerProvider
profiler
- the newly created profilerratpack.exec.UnmanagedThreadException
- if there is no current executionprotected void profilerStopped(Profiler profiler)
In theory we could remove the profiler from the execution here, but there's no need as executions are throwaway. This method is really here to support cleaning up threadlocals in thread pools.
profilerStopped
in class BaseProfilerProvider
profiler
- the stopped profilerprotected Profiler lookupCurrentProfiler()
lookupCurrentProfiler
in class BaseProfilerProvider
null
if there isn't one or there is no current execution