public interface Instrumentation
Modifier and Type | Method and Description |
---|---|
InstrumentationContext<ExecutionResult> |
beginDataFetch(InstrumentationDataFetchParameters parameters)
This is called just before the data fetch is started and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
InstrumentationContext<ExecutionResult> |
beginExecution(InstrumentationExecutionParameters parameters)
This is called just before a query is executed and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
InstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> |
beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
This is called each time the
ExecutionStrategy is invoked and when the
CompletableFuture has been dispatched for the query fields the
InstrumentationContext.onEnd(Object, Throwable)
is called. |
InstrumentationContext<ExecutionResult> |
beginField(InstrumentationFieldParameters parameters)
This is called just before a field is resolved and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
InstrumentationContext<java.lang.Object> |
beginFieldFetch(InstrumentationFieldFetchParameters parameters)
This is called just before a field
DataFetcher is invoked and when this step finishes the InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
InstrumentationContext<Document> |
beginParse(InstrumentationExecutionParameters parameters)
This is called just before a query is parsed and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
InstrumentationContext<java.util.List<ValidationError>> |
beginValidation(InstrumentationValidationParameters parameters)
This is called just before the parsed query Document is validated and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
default InstrumentationState |
createState()
This will be called just before execution to create an object that is given back to all instrumentation methods
to allow them to have per execution request state
|
default DataFetcher<?> |
instrumentDataFetcher(DataFetcher<?> dataFetcher,
InstrumentationFieldFetchParameters parameters)
This is called to instrument a
DataFetcher just before it is used to fetch a field, allowing you
to adjust what information is passed back or record information about specific data fetches. |
default java.util.concurrent.CompletableFuture<ExecutionResult> |
instrumentExecutionResult(ExecutionResult executionResult,
InstrumentationExecutionParameters parameters)
This is called to allow instrumentation to instrument the execution result in some way
|
default InstrumentationState createState()
InstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<java.util.List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<ExecutionResult> beginDataFetch(InstrumentationDataFetchParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
ExecutionStrategy
is invoked and when the
CompletableFuture
has been dispatched for the query fields the
InstrumentationContext.onEnd(Object, Throwable)
is called.
Note because the execution strategy execution is asynchronous, the query data is not guaranteed to be
completed when this step finishes. It is however a chance to dispatch side effects that might cause
asynchronous data fetching code to actually run or attach CompletableFuture handlers onto the result
via Instrumentation.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<java.lang.Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters)
DataFetcher
is invoked and when this step finishes the InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsdefault DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters)
DataFetcher
just before it is used to fetch a field, allowing you
to adjust what information is passed back or record information about specific data fetches. Note
the same data fetcher instance maybe presented to you many times and that data fetcher
implementations widely vary.dataFetcher
- the data fetcher about to be usedparameters
- the parameters describing the field to be fetcheddefault java.util.concurrent.CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters)
executionResult
- CompletableFuture
of the result to instrumentparameters
- the parameters to this step