Documentation ¶
Index ¶
- type NodeMap
- type Tracer
- func (Tracer) ExtensionName() string
- func (t *Tracer) InterceptField(ctx context.Context, next graphql.Resolver) (interface{}, error)
- func (t *Tracer) InterceptOperation(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler
- func (t *Tracer) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response
- func (t *Tracer) MutateOperationParameters(ctx context.Context, request *graphql.RawParams) *gqlerror.Error
- func (Tracer) Validate(graphql.ExecutableSchema) error
- type TreeBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tracer ¶
type Tracer struct { ClientName string Version string Hostname string TreeBuilder *TreeBuilder ShouldTrace bool }
func (Tracer) ExtensionName ¶
ExtensionName returns the name of the extension
func (*Tracer) InterceptField ¶
InterceptField is called on each field's resolution, including information about the path and parent node. This information is then used to build the relevant Node Tree used in the FTV1 tracing format
func (*Tracer) InterceptOperation ¶
func (t *Tracer) InterceptOperation(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler
InterceptOperation acts on each Graph operation; on each operation, start a tree builder and start the tree's timer for tracing
func (*Tracer) InterceptResponse ¶
func (t *Tracer) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response
InterceptResponse is called before the overall response is sent, but before each field resolves; as a result the final marshaling is deferred to happen at the end of the operation
func (*Tracer) MutateOperationParameters ¶
type TreeBuilder ¶
func NewTreeBuilder ¶
func NewTreeBuilder() *TreeBuilder
NewTreeBuilder is used to start the node tree with a default root node, along with the related tree nodes map entry
func (*TreeBuilder) StartTimer ¶
func (tb *TreeBuilder) StartTimer(ctx context.Context)
StartTimer marks the time using protobuf timestamp format for use in timing calculations
func (*TreeBuilder) StopTimer ¶
func (tb *TreeBuilder) StopTimer(ctx context.Context)
StopTimer marks the end of the timer, along with setting the related fields in the protobuf representation
func (*TreeBuilder) WillResolveField ¶
func (tb *TreeBuilder) WillResolveField(ctx context.Context)
On each field, it calculates the time started at as now - tree.StartTime, as well as a deferred function upon full resolution of the field as now - tree.StartTime; these are used by Apollo to calculate how fields are being resolved in the AST