Class SimplePerformantInstrumentation
java.lang.Object
graphql.execution.instrumentation.SimplePerformantInstrumentation
- All Implemented Interfaces:
Instrumentation
- Direct Known Subclasses:
DataLoaderDispatcherInstrumentation
,ExecutorInstrumentation
,FieldValidationInstrumentation
,MaxQueryComplexityInstrumentation
,MaxQueryDepthInstrumentation
,TracingInstrumentation
An implementation of
Instrumentation
that does nothing. It can be used
as a base for derived classes where you only implement the methods you want to. The reason this
class is designated as more performant is that it does not delegate back to the deprecated methods
and allocate a new state object per call.
This behavior was left in place for backwards compatibility reasons inside Instrumentation
and SimpleInstrumentation
but has not been done in this class since no existing classes
could have derived from it. If you want more performant behavior on methods you don't implement
then this is the base class to use, since it will not delegate back to old methods
and cause a new state to be allocated.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SimplePerformantInstrumentation
A singleton instance of aInstrumentation
that does nothing -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull InstrumentationContext
<ExecutionResult> This is called just before the execution of the query operation is started.@Nullable InstrumentationContext
<ExecutionResult> beginExecuteOperation
(InstrumentationExecuteOperationParameters parameters, InstrumentationState state) This is called just before the execution of the query operation is started.@NotNull InstrumentationContext
<ExecutionResult> beginExecution
(InstrumentationExecutionParameters parameters) This is called right at the start of query execution, and it's the first step in the instrumentation chain.@Nullable InstrumentationContext
<ExecutionResult> beginExecution
(InstrumentationExecutionParameters parameters, InstrumentationState state) This is called right at the start of query execution, and it's the first step in the instrumentation chain.This is called each time anExecutionStrategy
is invoked, which may be multiple times per query as the engine recursively descends down over the query.@Nullable ExecutionStrategyInstrumentationContext
beginExecutionStrategy
(InstrumentationExecutionStrategyParameters parameters, InstrumentationState state) This is called each time anExecutionStrategy
is invoked, which may be multiple times per query as the engine recursively descends down over the query.@NotNull InstrumentationContext
<ExecutionResult> beginField
(InstrumentationFieldParameters parameters) This is called just before a field is resolved into a value.@Nullable InstrumentationContext
<ExecutionResult> beginField
(InstrumentationFieldParameters parameters, InstrumentationState state) This is called just before a field is resolved into a value.@NotNull InstrumentationContext
<ExecutionResult> This is called just before the complete field is started.@Nullable InstrumentationContext
<ExecutionResult> beginFieldComplete
(InstrumentationFieldCompleteParameters parameters, InstrumentationState state) This is called just before the complete field is started.@NotNull InstrumentationContext
<Object> beginFieldFetch
(InstrumentationFieldFetchParameters parameters) This is called just before a fieldDataFetcher
is invoked.@Nullable InstrumentationContext
<Object> beginFieldFetch
(InstrumentationFieldFetchParameters parameters, InstrumentationState state) This is called just before a fieldDataFetcher
is invoked.@NotNull InstrumentationContext
<ExecutionResult> This is called just before the complete field list is started.@Nullable InstrumentationContext
<ExecutionResult> beginFieldListComplete
(InstrumentationFieldCompleteParameters parameters, InstrumentationState state) This is called just before the complete field list is started.@NotNull InstrumentationContext
<Document> beginParse
(InstrumentationExecutionParameters parameters) This is called just before a query is parsed.@Nullable InstrumentationContext
<Document> beginParse
(InstrumentationExecutionParameters parameters, InstrumentationState state) This is called just before a query is parsed.@NotNull InstrumentationContext
<ExecutionResult> This is called each time a subscription field produces a new reactive stream event value and it needs to be mapped over via the graphql field subselection.@Nullable InstrumentationContext
<ExecutionResult> beginSubscribedFieldEvent
(InstrumentationFieldParameters parameters, InstrumentationState state) This is called each time a subscription field produces a new reactive stream event value and it needs to be mapped over via the graphql field subselection.@NotNull InstrumentationContext
<List<ValidationError>> beginValidation
(InstrumentationValidationParameters parameters) This is called just before the parsed query document is validated.@Nullable InstrumentationContext
<List<ValidationError>> beginValidation
(InstrumentationValidationParameters parameters, InstrumentationState state) This is called just before the parsed query document is validated.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@Nullable InstrumentationState
createState
(InstrumentationCreateStateParameters parameters) 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@Nullable CompletableFuture
<InstrumentationState> createStateAsync
(InstrumentationCreateStateParameters parameters) This will be called just before execution to create an object, in an asynchronous manner, that is given back to all instrumentation methods to allow them to have per execution request state@NotNull DataFetcher
<?> instrumentDataFetcher
(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters) This is called to instrument aDataFetcher
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.@NotNull DataFetcher
<?> instrumentDataFetcher
(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters, InstrumentationState state) This is called to instrument aDataFetcher
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.@NotNull DocumentAndVariables
instrumentDocumentAndVariables
(DocumentAndVariables documentAndVariables, InstrumentationExecutionParameters parameters) This is called to instrument aDocument
and variables before it is used allowing you to adjust the query AST if you so desire@NotNull DocumentAndVariables
instrumentDocumentAndVariables
(DocumentAndVariables documentAndVariables, InstrumentationExecutionParameters parameters, InstrumentationState state) This is called to instrument aDocument
and variables before it is used allowing you to adjust the query AST if you so desire@NotNull ExecutionContext
instrumentExecutionContext
(ExecutionContext executionContext, InstrumentationExecutionParameters parameters) This is called to instrument aExecutionContext
before it is used to execute a query, allowing you to adjust the base data used.@NotNull ExecutionContext
instrumentExecutionContext
(ExecutionContext executionContext, InstrumentationExecutionParameters parameters, InstrumentationState state) This is called to instrument aExecutionContext
before it is used to execute a query, allowing you to adjust the base data used.@NotNull ExecutionInput
instrumentExecutionInput
(ExecutionInput executionInput, InstrumentationExecutionParameters parameters) This is called to instrument aExecutionInput
before it is used to parse, validate and execute a query, allowing you to adjust what query input parameters are used@NotNull ExecutionInput
instrumentExecutionInput
(ExecutionInput executionInput, InstrumentationExecutionParameters parameters, InstrumentationState state) This is called to instrument aExecutionInput
before it is used to parse, validate and execute a query, allowing you to adjust what query input parameters are used@NotNull CompletableFuture
<ExecutionResult> instrumentExecutionResult
(ExecutionResult executionResult, InstrumentationExecutionParameters parameters) This is called to allow instrumentation to instrument the execution result in some way@NotNull CompletableFuture
<ExecutionResult> instrumentExecutionResult
(ExecutionResult executionResult, InstrumentationExecutionParameters parameters, InstrumentationState state) This is called to allow instrumentation to instrument the execution result in some way@NotNull GraphQLSchema
instrumentSchema
(GraphQLSchema schema, InstrumentationExecutionParameters parameters) This is called to instrument aGraphQLSchema
before it is used to parse, validate and execute a query, allowing you to adjust what types are used.@NotNull GraphQLSchema
instrumentSchema
(GraphQLSchema schema, InstrumentationExecutionParameters parameters, InstrumentationState state) This is called to instrument aGraphQLSchema
before it is used to parse, validate and execute a query, allowing you to adjust what types are used.
-
Field Details
-
INSTANCE
A singleton instance of aInstrumentation
that does nothing
-
-
Constructor Details
-
SimplePerformantInstrumentation
public SimplePerformantInstrumentation()
-
-
Method Details
-
createState
Description copied from interface:Instrumentation
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- Specified by:
createState
in interfaceInstrumentation
- Returns:
- a state object that is passed to each method
-
createState
@Nullable public @Nullable InstrumentationState createState(InstrumentationCreateStateParameters parameters) Description copied from interface:Instrumentation
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- Specified by:
createState
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a state object that is passed to each method
-
createStateAsync
@Nullable public @Nullable CompletableFuture<InstrumentationState> createStateAsync(InstrumentationCreateStateParameters parameters) Description copied from interface:Instrumentation
This will be called just before execution to create an object, in an asynchronous manner, that is given back to all instrumentation methods to allow them to have per execution request state- Specified by:
createStateAsync
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a state object that is passed to each method
-
beginExecution
@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters) Description copied from interface:Instrumentation
This is called right at the start of query execution, and it's the first step in the instrumentation chain.- Specified by:
beginExecution
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a non null
InstrumentationContext
object that will be called back when the step ends
-
beginExecution
@Nullable public @Nullable InstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called right at the start of query execution, and it's the first step in the instrumentation chain.- Specified by:
beginExecution
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a nullable
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
beginParse
@NotNull public @NotNull InstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters) Description copied from interface:Instrumentation
This is called just before a query is parsed.- Specified by:
beginParse
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a non null
InstrumentationContext
object that will be called back when the step ends
-
beginParse
@Nullable public @Nullable InstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called just before a query is parsed.- Specified by:
beginParse
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a nullable
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
beginValidation
@NotNull public @NotNull InstrumentationContext<List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters) Description copied from interface:Instrumentation
This is called just before the parsed query document is validated.- Specified by:
beginValidation
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a non null
InstrumentationContext
object that will be called back when the step ends
-
beginValidation
@Nullable public @Nullable InstrumentationContext<List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called just before the parsed query document is validated.- Specified by:
beginValidation
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a nullable
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
beginExecuteOperation
@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters) Description copied from interface:Instrumentation
This is called just before the execution of the query operation is started.- Specified by:
beginExecuteOperation
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a non null
InstrumentationContext
object that will be called back when the step ends
-
beginExecuteOperation
@Nullable public @Nullable InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called just before the execution of the query operation is started.- Specified by:
beginExecuteOperation
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a nullable
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
beginExecutionStrategy
@NotNull public @NotNull ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters) Description copied from interface:Instrumentation
This is called each time anExecutionStrategy
is invoked, which may be multiple times per query as the engine recursively descends down over the query.- Specified by:
beginExecutionStrategy
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a non null
ExecutionStrategyInstrumentationContext
object that will be called back when the step ends
-
beginExecutionStrategy
@Nullable public @Nullable ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called each time anExecutionStrategy
is invoked, which may be multiple times per query as the engine recursively descends down over the query.- Specified by:
beginExecutionStrategy
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a nullable
ExecutionStrategyInstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
beginSubscribedFieldEvent
@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginSubscribedFieldEvent(InstrumentationFieldParameters parameters) Description copied from interface:Instrumentation
This is called each time a subscription field produces a new reactive stream event value and it needs to be mapped over via the graphql field subselection.- Specified by:
beginSubscribedFieldEvent
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a non null
InstrumentationContext
object that will be called back when the step ends
-
beginSubscribedFieldEvent
@Nullable public @Nullable InstrumentationContext<ExecutionResult> beginSubscribedFieldEvent(InstrumentationFieldParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called each time a subscription field produces a new reactive stream event value and it needs to be mapped over via the graphql field subselection.- Specified by:
beginSubscribedFieldEvent
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a nullable
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
beginField
@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters) Description copied from interface:Instrumentation
This is called just before a field is resolved into a value.- Specified by:
beginField
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a non null
InstrumentationContext
object that will be called back when the step ends
-
beginField
@Nullable public @Nullable InstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called just before a field is resolved into a value.- Specified by:
beginField
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a nullable
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
beginFieldFetch
@NotNull public @NotNull InstrumentationContext<Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters) Description copied from interface:Instrumentation
This is called just before a fieldDataFetcher
is invoked.- Specified by:
beginFieldFetch
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a non null
InstrumentationContext
object that will be called back when the step ends
-
beginFieldFetch
@Nullable public @Nullable InstrumentationContext<Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called just before a fieldDataFetcher
is invoked.- Specified by:
beginFieldFetch
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a nullable
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
beginFieldComplete
@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginFieldComplete(InstrumentationFieldCompleteParameters parameters) Description copied from interface:Instrumentation
This is called just before the complete field is started.- Specified by:
beginFieldComplete
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a non null
InstrumentationContext
object that will be called back when the step ends
-
beginFieldComplete
@Nullable public @Nullable InstrumentationContext<ExecutionResult> beginFieldComplete(InstrumentationFieldCompleteParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called just before the complete field is started.- Specified by:
beginFieldComplete
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a nullable
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
beginFieldListComplete
@NotNull public @NotNull InstrumentationContext<ExecutionResult> beginFieldListComplete(InstrumentationFieldCompleteParameters parameters) Description copied from interface:Instrumentation
This is called just before the complete field list is started.- Specified by:
beginFieldListComplete
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this step- Returns:
- a non null
InstrumentationContext
object that will be called back when the step ends
-
beginFieldListComplete
@Nullable public @Nullable InstrumentationContext<ExecutionResult> beginFieldListComplete(InstrumentationFieldCompleteParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called just before the complete field list is started.- Specified by:
beginFieldListComplete
in interfaceInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a nullable
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
instrumentExecutionInput
@NotNull public @NotNull ExecutionInput instrumentExecutionInput(ExecutionInput executionInput, InstrumentationExecutionParameters parameters) Description copied from interface:Instrumentation
This is called to instrument aExecutionInput
before it is used to parse, validate and execute a query, allowing you to adjust what query input parameters are used- Specified by:
instrumentExecutionInput
in interfaceInstrumentation
- Parameters:
executionInput
- the execution input to be usedparameters
- the parameters describing the field to be fetched- Returns:
- a non null instrumented ExecutionInput, the default is to return to the same object
-
instrumentExecutionInput
@NotNull public @NotNull ExecutionInput instrumentExecutionInput(ExecutionInput executionInput, InstrumentationExecutionParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called to instrument aExecutionInput
before it is used to parse, validate and execute a query, allowing you to adjust what query input parameters are used- Specified by:
instrumentExecutionInput
in interfaceInstrumentation
- Parameters:
executionInput
- the execution input to be usedparameters
- the parameters describing the field to be fetchedstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a non null instrumented ExecutionInput, the default is to return to the same object
-
instrumentDocumentAndVariables
@NotNull public @NotNull DocumentAndVariables instrumentDocumentAndVariables(DocumentAndVariables documentAndVariables, InstrumentationExecutionParameters parameters) Description copied from interface:Instrumentation
This is called to instrument aDocument
and variables before it is used allowing you to adjust the query AST if you so desire- Specified by:
instrumentDocumentAndVariables
in interfaceInstrumentation
- Parameters:
documentAndVariables
- the document and variables to be usedparameters
- the parameters describing the execution- Returns:
- a non null instrumented DocumentAndVariables, the default is to return to the same objects
-
instrumentDocumentAndVariables
@NotNull public @NotNull DocumentAndVariables instrumentDocumentAndVariables(DocumentAndVariables documentAndVariables, InstrumentationExecutionParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called to instrument aDocument
and variables before it is used allowing you to adjust the query AST if you so desire- Specified by:
instrumentDocumentAndVariables
in interfaceInstrumentation
- Parameters:
documentAndVariables
- the document and variables to be usedparameters
- the parameters describing the executionstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a non null instrumented DocumentAndVariables, the default is to return to the same objects
-
instrumentSchema
@NotNull public @NotNull GraphQLSchema instrumentSchema(GraphQLSchema schema, InstrumentationExecutionParameters parameters) Description copied from interface:Instrumentation
This is called to instrument aGraphQLSchema
before it is used to parse, validate and execute a query, allowing you to adjust what types are used.- Specified by:
instrumentSchema
in interfaceInstrumentation
- Parameters:
schema
- the schema to be usedparameters
- the parameters describing the field to be fetched- Returns:
- a non null instrumented GraphQLSchema, the default is to return to the same object
-
instrumentSchema
@NotNull public @NotNull GraphQLSchema instrumentSchema(GraphQLSchema schema, InstrumentationExecutionParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called to instrument aGraphQLSchema
before it is used to parse, validate and execute a query, allowing you to adjust what types are used.- Specified by:
instrumentSchema
in interfaceInstrumentation
- Parameters:
schema
- the schema to be usedparameters
- the parameters describing the field to be fetchedstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a non null instrumented GraphQLSchema, the default is to return to the same object
-
instrumentExecutionContext
@NotNull public @NotNull ExecutionContext instrumentExecutionContext(ExecutionContext executionContext, InstrumentationExecutionParameters parameters) Description copied from interface:Instrumentation
This is called to instrument aExecutionContext
before it is used to execute a query, allowing you to adjust the base data used.- Specified by:
instrumentExecutionContext
in interfaceInstrumentation
- Parameters:
executionContext
- the execution context to be usedparameters
- the parameters describing the field to be fetched- Returns:
- a non null instrumented ExecutionContext, the default is to return to the same object
-
instrumentExecutionContext
@NotNull public @NotNull ExecutionContext instrumentExecutionContext(ExecutionContext executionContext, InstrumentationExecutionParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called to instrument aExecutionContext
before it is used to execute a query, allowing you to adjust the base data used.- Specified by:
instrumentExecutionContext
in interfaceInstrumentation
- Parameters:
executionContext
- the execution context to be usedparameters
- the parameters describing the field to be fetchedstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a non null instrumented ExecutionContext, the default is to return to the same object
-
instrumentDataFetcher
@NotNull public @NotNull DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters) Description copied from interface:Instrumentation
This is called to instrument aDataFetcher
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.- Specified by:
instrumentDataFetcher
in interfaceInstrumentation
- Parameters:
dataFetcher
- the data fetcher about to be usedparameters
- the parameters describing the field to be fetched- Returns:
- a non null instrumented DataFetcher, the default is to return to the same object
-
instrumentDataFetcher
@NotNull public @NotNull DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called to instrument aDataFetcher
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.- Specified by:
instrumentDataFetcher
in interfaceInstrumentation
- Parameters:
dataFetcher
- the data fetcher about to be usedparameters
- the parameters describing the field to be fetchedstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a non null instrumented DataFetcher, the default is to return to the same object
-
instrumentExecutionResult
@NotNull public @NotNull CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters) Description copied from interface:Instrumentation
This is called to allow instrumentation to instrument the execution result in some way- Specified by:
instrumentExecutionResult
in interfaceInstrumentation
- Parameters:
executionResult
-CompletableFuture
of the result to instrumentparameters
- the parameters to this step- Returns:
- a new execution result completable future
-
instrumentExecutionResult
@NotNull public @NotNull CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters, InstrumentationState state) Description copied from interface:Instrumentation
This is called to allow instrumentation to instrument the execution result in some way- Specified by:
instrumentExecutionResult
in interfaceInstrumentation
- Parameters:
executionResult
-CompletableFuture
of the result to instrumentparameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createState(InstrumentationCreateStateParameters)
- Returns:
- a new execution result completable future
-