public class MiniProfilerRatpackUtil
extends java.lang.Object
Constructor and Description |
---|
MiniProfilerRatpackUtil() |
Modifier and Type | Method and Description |
---|---|
static <T extends ratpack.exec.ExecSpec> |
forkChildProfiler(T execSpec,
java.lang.String forkedExecutionName)
Add a child profiler of the current execution's profiler to a forked execution.
|
static <T extends ratpack.exec.ExecSpec> |
forkChildProfiler(T execSpec,
java.lang.String forkedExecutionName,
ratpack.func.Action<? super ratpack.exec.Execution> onStart)
Add a child profiler of the current execution's profiler to a forked execution.
|
static <T> ratpack.exec.Promise<T> |
profile(Profiler profiler,
java.lang.String name,
ratpack.exec.Promise<T> promise)
Add a profiling step for the promise, starting with when the promise is first subscribed-to and finishing
when the promise supplies results.
|
static <T> ratpack.exec.Promise<T> |
profileFromNow(Profiler profiler,
java.lang.String name,
ratpack.exec.Promise<T> promise)
Add a profiling step for the promise, starting with the current time and finishing
when the promise supplies results.
|
public static <T> ratpack.exec.Promise<T> profile(Profiler profiler, java.lang.String name, ratpack.exec.Promise<T> promise)
T
- the type of the promiseprofiler
- the profiler to usename
- the name of the profiling steppromise
- the promise to profilepublic static <T> ratpack.exec.Promise<T> profileFromNow(Profiler profiler, java.lang.String name, ratpack.exec.Promise<T> promise)
T
- the type of the promiseprofiler
- the profiler to usename
- the name of the profiling steppromise
- the promise to profilepublic static <T extends ratpack.exec.ExecSpec> T forkChildProfiler(T execSpec, java.lang.String forkedExecutionName)
Timing steps added to the child profiler will appear in the profiling report as children of the current profiling step, but the timings will not affect timing calculations as the work happens in parallel.
T
- The ExecSpec type (e.g. ExecStarter)execSpec
- the spec for the forked executionforkedExecutionName
- the name to give the childpublic static <T extends ratpack.exec.ExecSpec> T forkChildProfiler(T execSpec, java.lang.String forkedExecutionName, ratpack.func.Action<? super ratpack.exec.Execution> onStart)
Timing steps added to the child profiler will appear in the profiling report as children of the current profiling step, but the timings will not affect timing calculations as the work happens in parallel.
This version accepts an onStart action to compose in, as the mechanism used to attach
the child profiler to the new execution is via ExecSpec.onStart(Action)
, but
multiple calls to that method are not additive.
T
- The ExecSpec type (e.g. ExecStarter)execSpec
- the spec for the forked executionforkedExecutionName
- the name to give the childonStart
- an onStart action to execute after attaching the child profiler