throughput

package
v0.0.0-...-c28e036 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

Tracker collects bytes sent by the Agent and produces a throughput measurement.

func NewTracker

func NewTracker(ctx context.Context) *Tracker

NewTracker returns a new Tracker, which can then be used to track bytes sent and produce a throughput measurement.

func (*Tracker) RecordBytesSent

func (t *Tracker) RecordBytesSent(bytes int64)

RecordBytesSent tracks bytes sent. For accurate throughput measurement this function should be called every time bytes are sent on the wire. More frequent and granular calls to this function will provide a more accurate throughput measurement.

Takes no action for a nil receiver.

func (*Tracker) Throughput

func (t *Tracker) Throughput() int64

Throughput returns the current measured throughput in bytes/second.

Returns zero for a nil receiver.

Jump to

Keyboard shortcuts

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