Class NoContextChainedInstrumentation

java.lang.Object
graphql.execution.instrumentation.ChainedInstrumentation
graphql.execution.instrumentation.NoContextChainedInstrumentation
All Implemented Interfaces:
Instrumentation

@PublicApi public class NoContextChainedInstrumentation extends ChainedInstrumentation
This version of 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.