Documentation ¶
Overview ¶
Package tracing implements support for tracing the behavior of a FlowLimiter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TraceLimiter ¶
type TraceLimiter struct {
// contains filtered or unexported fields
}
A TraceLimiter wraps an underlying FlowLimiter, and records data about messages.
func New ¶
func New(underlying flowcontrol.FlowLimiter, emitRecord func(TraceRecord)) *TraceLimiter
Return a new TraceLimiter, wrapping underlying. Each time one of the limiter's gotResponse() callbacks is invoked, emitRecord is called with data about the call.
func (*TraceLimiter) Release ¶
func (l *TraceLimiter) Release()
Release releases the underlying flow limiter.
func (*TraceLimiter) StartMessage ¶
func (l *TraceLimiter) StartMessage(ctx context.Context, size uint64) (gotResponse func(), err error)
StartMessage implements FlowLimiter.StartMessage for TraceLimiter.
type TraceRecord ¶
type TraceRecord struct { Size uint64 // The size of the message RequestAt time.Time // The time at which StartMessage() was called. ProceedAt time.Time // The time at which StartMessage() returned. ResponseAt time.Time // The time at which gotResponse() was called. }
A TraceRecord records information about a message sent through the limiter.
Click to show internal directories.
Click to hide internal directories.