stats

package
v0.0.0-...-c8b15d8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	LongDelay = 3 * time.Second
)

Variables

View Source
var (
	IncomingPacketChanBuffer = 50
)

Functions

This section is empty.

Types

type AggregatedStats

type AggregatedStats []namedResults

func (*AggregatedStats) Aggregate

func (agg *AggregatedStats) Aggregate(stats *Stats)

func (AggregatedStats) Flush

func (agg AggregatedStats) Flush(seconds uint)

func (AggregatedStats) Len

func (agg AggregatedStats) Len() int

func (AggregatedStats) Less

func (agg AggregatedStats) Less(i, j int) bool

func (*AggregatedStats) Results

func (agg *AggregatedStats) Results(name string) *Results

func (AggregatedStats) Start

func (agg AggregatedStats) Start()

func (AggregatedStats) Stop

func (agg AggregatedStats) Stop()

func (AggregatedStats) String

func (agg AggregatedStats) String() string

func (AggregatedStats) Swap

func (agg AggregatedStats) Swap(i, j int)

type Results

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

func NewResults

func NewResults() *Results

func (*Results) Bytes

func (stats *Results) Bytes() uint

func (*Results) BytesPerSecond

func (stats *Results) BytesPerSecond() float32

func (*Results) Flush

func (stats *Results) Flush(secondsAge uint)

func (*Results) Packets

func (stats *Results) Packets() uint

func (*Results) PacketsPerSecond

func (stats *Results) PacketsPerSecond() float32

func (*Results) String

func (stats *Results) String() string

type Stats

type Stats struct {
	Results *Results // Don't change after calling Start()
	Name    string
}

func NewStats

func NewStats(name string) *Stats

func (*Stats) AddNow

func (stats *Stats) AddNow(bytes uint)

func (*Stats) AddPacket

func (stats *Stats) AddPacket(t time.Time)

func (*Stats) AddPacketNow

func (stats *Stats) AddPacketNow()

func (*Stats) AddPackets

func (stats *Stats) AddPackets(t time.Time, num uint)

func (*Stats) AddPacketsNow

func (stats *Stats) AddPacketsNow(num uint)

func (*Stats) Start

func (stats *Stats) Start()

func (*Stats) Stop

func (stats *Stats) Stop()

func (*Stats) String

func (stats *Stats) String() string

Jump to

Keyboard shortcuts

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