tracing

package
v3.0.0-alpha-29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2023 License: MIT Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL