Class TracingSupport

  • All Implemented Interfaces:
    InstrumentationState

    @PublicApi
    public class TracingSupport
    extends java.lang.Object
    implements InstrumentationState
    This creates a map of tracing information as outlined in https://github.com/apollographql/apollo-tracing

    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.

    • Field Detail

      • startRequestTime

        private final java.time.Instant startRequestTime
      • startRequestNanos

        private final long startRequestNanos
      • fieldData

        private final java.util.concurrent.ConcurrentLinkedQueue<java.util.Map<java.lang.String,​java.lang.Object>> fieldData
      • parseMap

        private final java.util.Map<java.lang.String,​java.lang.Object> parseMap
      • validationMap

        private final java.util.Map<java.lang.String,​java.lang.Object> validationMap
      • includeTrivialDataFetchers

        private final boolean includeTrivialDataFetchers
    • Constructor Detail

      • TracingSupport

        public TracingSupport​(boolean includeTrivialDataFetchers)
        The timer starts as soon as you create this object
        Parameters:
        includeTrivialDataFetchers - whether the trace trivial data fetchers
    • Method Detail

      • snapshotTracingData

        public java.util.Map<java.lang.String,​java.lang.Object> snapshotTracingData()
        This will snapshot this tracing and return a map of the results
        Returns:
        a snapshot of the tracing data
      • copyMap

        private java.lang.Object copyMap​(java.util.Map<java.lang.String,​java.lang.Object> map)
      • executionData

        private java.util.Map<java.lang.String,​java.lang.Object> executionData()
      • rfc3339

        private java.lang.String rfc3339​(java.time.Instant time)