Documentation ¶
Overview ¶
Package timing provides a plugin Xavi wires in as the enclosing wrapper for the user specified plugin chain. This plugin creates and puts an EndToEndTimer into the context that downstream components may annotate with the service name and contributors of note. The JSON representation of the timing is logged on completion of the wrapped call chain.
Index ¶
- func AddServiceNameToContext(ctx context.Context, serviceName string) context.Context
- func GetServiceNameFromContext(ctx context.Context) string
- func NewContextWithNamedTimer(ctx context.Context, name string) context.Context
- func NewContextWithTimer(ctx context.Context) context.Context
- func NewTimingWrapper(args ...interface{}) plugin.Wrapper
- func TimerFromContext(ctx context.Context) *timer.EndToEndTimer
- type TimingWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddServiceNameToContext ¶
AddServiceNameToContext adds the name of the service the backend handler will invoke. This provides a service name in the output timing log to allow the latency of different backend services to be assessed.
func GetServiceNameFromContext ¶
GetServiceNameFromContext pulls the service name from the context.
func NewContextWithNamedTimer ¶
NewContextWithNamedTimer adds a new timer to the request context
func NewContextWithTimer ¶
NewContextWithTimer adds a new timer to the request context
func NewTimingWrapper ¶
NewTimingWrapper returns a Wrapper that will trace the round trip time of the request. It is possible to specify the initial name of the timer passing a string to this function.
func TimerFromContext ¶
func TimerFromContext(ctx context.Context) *timer.EndToEndTimer
TimerFromContext returns an EndToEndTimer from the given context if one is present, otherwise nil is returned
Types ¶
type TimingWrapper ¶
type TimingWrapper struct {
// contains filtered or unexported fields
}