@PublicApi public class NoContextChainedInstrumentation extends ChainedInstrumentation
ChainedInstrumentation will call a list of Instrumentations
but it will never back on the returned InstrumentationContext objects, hence it is only suitable to
certain use cases.
Only use this class if you are optimising for memory usage as scale. In most cases the ChainedInstrumentation
will do the job required with all the instrumentation features used however some users require the fastest performance and lowest memory
usage at scale and this class can be used.
At scale, the fact that the graphql engine holds the InstrumentationContext objects in memory for a (relatively) long time
(the length of the request or the length of a large field fetch) means that memory pressure can grow
and objects move into longer tenure GC pools. Holding these contexts is also not necessary if the instrumentation never needs to know when a
certain execution step finishes.
The InstrumentationContext is used ot know when an execution step has completed, so instrumentations that do
timings say need to use this callback mechanism. Putting such an instrumentation into NoContextChainedInstrumentation would
be a mistake because no callback will occur. Therefore, use of this class is reserved for very specific us cases. You are fore-warned.
This class never holds onto the returned InstrumentationContext objects and always returns null
as itself.instrumentations| Constructor and Description |
|---|
NoContextChainedInstrumentation(Instrumentation... instrumentations) |
NoContextChainedInstrumentation(java.util.List<Instrumentation> instrumentations) |
| Modifier and Type | Method and Description |
|---|---|
InstrumentationContext<ExecutionResult> |
beginExecuteOperation(InstrumentationExecuteOperationParameters parameters,
InstrumentationState state)
This is called just before the execution of the query operation is started.
|
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.
|
ExecutionStrategyInstrumentationContext |
beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters,
InstrumentationState state)
This is called each time an
ExecutionStrategy is invoked, which may be multiple times
per query as the engine recursively descends down over the query. |
InstrumentationContext<ExecutionResult> |
beginField(InstrumentationFieldParameters parameters,
InstrumentationState state)
This is called just before a field is resolved into a value.
|
InstrumentationContext<ExecutionResult> |
beginFieldComplete(InstrumentationFieldCompleteParameters parameters,
InstrumentationState state)
This is called just before the complete field is started.
|
InstrumentationContext<java.lang.Object> |
beginFieldFetch(InstrumentationFieldFetchParameters parameters,
InstrumentationState state)
This is called just before a field
DataFetcher is invoked. |
InstrumentationContext<ExecutionResult> |
beginFieldListComplete(InstrumentationFieldCompleteParameters parameters,
InstrumentationState state)
This is called just before the complete field list is started.
|
InstrumentationContext<Document> |
beginParse(InstrumentationExecutionParameters parameters,
InstrumentationState state)
This is called just before a query is parsed.
|
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.
|
InstrumentationContext<java.util.List<ValidationError>> |
beginValidation(InstrumentationValidationParameters parameters,
InstrumentationState state)
This is called just before the parsed query document is validated.
|
beginExecuteOperation, beginExecution, beginExecutionStrategy, beginField, beginFieldComplete, beginFieldFetch, beginFieldListComplete, beginParse, beginSubscribedFieldEvent, beginValidation, createState, getInstrumentations, getSpecificState, instrumentDataFetcher, instrumentDataFetcher, instrumentDocumentAndVariables, instrumentDocumentAndVariables, instrumentExecutionContext, instrumentExecutionContext, instrumentExecutionInput, instrumentExecutionInput, instrumentExecutionResult, instrumentExecutionResult, instrumentSchema, instrumentSchemaclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateStatepublic NoContextChainedInstrumentation(java.util.List<Instrumentation> instrumentations)
public NoContextChainedInstrumentation(Instrumentation... instrumentations)
public InstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters, InstrumentationState state)
InstrumentationbeginExecution in interface InstrumentationbeginExecution in class ChainedInstrumentationparameters - the parameters to this stepstate - the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)InstrumentationContext object that will be called back when the step ends (assuming it's not null)public InstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters, InstrumentationState state)
InstrumentationbeginParse in interface InstrumentationbeginParse in class ChainedInstrumentationparameters - the parameters to this stepstate - the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)InstrumentationContext object that will be called back when the step ends (assuming it's not null)public InstrumentationContext<java.util.List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters, InstrumentationState state)
InstrumentationbeginValidation in interface InstrumentationbeginValidation in class ChainedInstrumentationparameters - the parameters to this stepstate - the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)InstrumentationContext object that will be called back when the step ends (assuming it's not null)public InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters, InstrumentationState state)
InstrumentationbeginExecuteOperation in interface InstrumentationbeginExecuteOperation in class ChainedInstrumentationparameters - the parameters to this stepstate - the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)InstrumentationContext object that will be called back when the step ends (assuming it's not null)public ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters, InstrumentationState state)
InstrumentationExecutionStrategy is invoked, which may be multiple times
per query as the engine recursively descends down over the query.beginExecutionStrategy in interface InstrumentationbeginExecutionStrategy in class ChainedInstrumentationparameters - the parameters to this stepstate - the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)ExecutionStrategyInstrumentationContext object that will be called back when the step ends (assuming it's not null)public InstrumentationContext<ExecutionResult> beginSubscribedFieldEvent(InstrumentationFieldParameters parameters, InstrumentationState state)
InstrumentationbeginSubscribedFieldEvent in interface InstrumentationbeginSubscribedFieldEvent in class ChainedInstrumentationparameters - the parameters to this stepstate - the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)InstrumentationContext object that will be called back when the step ends (assuming it's not null)public InstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters, InstrumentationState state)
InstrumentationbeginField in interface InstrumentationbeginField in class ChainedInstrumentationparameters - the parameters to this stepstate - the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)InstrumentationContext object that will be called back when the step ends (assuming it's not null)public InstrumentationContext<java.lang.Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters, InstrumentationState state)
InstrumentationDataFetcher is invoked.beginFieldFetch in interface InstrumentationbeginFieldFetch in class ChainedInstrumentationparameters - the parameters to this stepstate - the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)InstrumentationContext object that will be called back when the step ends (assuming it's not null)public InstrumentationContext<ExecutionResult> beginFieldComplete(InstrumentationFieldCompleteParameters parameters, InstrumentationState state)
InstrumentationbeginFieldComplete in interface InstrumentationbeginFieldComplete in class ChainedInstrumentationparameters - the parameters to this stepstate - the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)InstrumentationContext object that will be called back when the step ends (assuming it's not null)public InstrumentationContext<ExecutionResult> beginFieldListComplete(InstrumentationFieldCompleteParameters parameters, InstrumentationState state)
InstrumentationbeginFieldListComplete in interface InstrumentationbeginFieldListComplete in class ChainedInstrumentationparameters - the parameters to this stepstate - the state created during the call to Instrumentation.createState(InstrumentationCreateStateParameters)InstrumentationContext object that will be called back when the step ends (assuming it's not null)