@PublicApi public class TracingSupport extends java.lang.Object implements InstrumentationState
This is a stateful object that should be instantiated and called via Instrumentation
calls. It has been made a separate class so that you can compose this into existing
instrumentation code.
Modifier and Type | Class and Description |
---|---|
static interface |
TracingSupport.TracingContext
A simple object that you need to call
TracingSupport.TracingContext.onEnd() on |
Constructor and Description |
---|
TracingSupport(boolean includeTrivialDataFetchers)
The timer starts as soon as you create this object
|
Modifier and Type | Method and Description |
---|---|
TracingSupport.TracingContext |
beginField(DataFetchingEnvironment dataFetchingEnvironment,
boolean trivialDataFetcher)
This should be called to start the trace of a field, with
TracingSupport.TracingContext.onEnd() being called to
end the call. |
TracingSupport.TracingContext |
beginParse()
This should be called to start the trace of query parsing, with
TracingSupport.TracingContext.onEnd() being called to
end the call. |
TracingSupport.TracingContext |
beginValidation()
This should be called to start the trace of query validation, with
TracingSupport.TracingContext.onEnd() being called to
end the call. |
java.util.Map<java.lang.String,java.lang.Object> |
snapshotTracingData()
This will snapshot this tracing and return a map of the results
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ofState
public TracingSupport(boolean includeTrivialDataFetchers)
includeTrivialDataFetchers
- whether the trace trivial data fetcherspublic TracingSupport.TracingContext beginField(DataFetchingEnvironment dataFetchingEnvironment, boolean trivialDataFetcher)
TracingSupport.TracingContext.onEnd()
being called to
end the call.dataFetchingEnvironment
- the data fetching that is occurringtrivialDataFetcher
- if the data fetcher is considered trivialpublic TracingSupport.TracingContext beginParse()
TracingSupport.TracingContext.onEnd()
being called to
end the call.public TracingSupport.TracingContext beginValidation()
TracingSupport.TracingContext.onEnd()
being called to
end the call.public java.util.Map<java.lang.String,java.lang.Object> snapshotTracingData()