Documentation ¶
Overview ¶
Package throttling wraps connections to measure throttling.
Index ¶
Constants ¶
View Source
const BytesReceivedCumulativeOperation = "bytes_received_cumulative"
BytesReceivedCumulativeOperation is the operation we set for network events.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sampler ¶
type Sampler struct {
// contains filtered or unexported fields
}
Sampler periodically samples the bytes sent and received by a Trace. The zero value of this structure is invalid; please, construct using NewSampler.
func NewSampler ¶
NewSampler attaches a *Sampler to a Trace, starts sampling in the background and returns the *Sampler. Remember to call *Sampler.Close to stop the background goroutine that performs the sampling.
func (*Sampler) ExtractSamples ¶
func (smpl *Sampler) ExtractSamples() []*model.ArchivalNetworkEvent
ExtractSamples extracts the samples from the *Sampler
type Trace ¶ added in v0.27.0
type Trace interface { // CloneBytesReceivedMap returns a clone of the internal bytes received map. The key of the // map is a string following the "EPNT_ADDRESS PROTO" pattern where the "EPNT_ADDRESS" contains // the endpoint address and "PROTO" is "tcp" or "udp". CloneBytesReceivedMap() (out map[string]int64) // Index returns the unique index used by this trace. Index() int64 // Tags returns the trace tags. Tags() []string // TimeSince is equivalent to Trace.TimeNow().Sub(t0). TimeSince(t0 time.Time) time.Duration // ZeroTime returns the "zero" time of this trace. ZeroTime() time.Time }
Trace is the [*measurexlite.Trace] abstraction used by this package.
Click to show internal directories.
Click to hide internal directories.