counters

package
v0.0.0-...-014b5c3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	/* Stats update interval */
	INTERVAL = 2 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendsBandwidthCounter

type BackendsBandwidthCounter struct {

	/* Input channel of updated targets */
	In chan []core.Target

	/* Input channel of traffic deltas */
	Traffic chan core.ReadWriteCount

	/* Output channel for counted stats */
	Out chan BandwidthStats
	// contains filtered or unexported fields
}

*

  • Bandwidth counter for backends pool

func NewBackendsBandwidthCounter

func NewBackendsBandwidthCounter() *BackendsBandwidthCounter

*

  • Creates new backends bandwidth counter

func (*BackendsBandwidthCounter) Start

func (this *BackendsBandwidthCounter) Start()

*

  • Start backends counter

func (*BackendsBandwidthCounter) Stop

func (this *BackendsBandwidthCounter) Stop()

*

  • Stop backends counter

func (*BackendsBandwidthCounter) UpdateCounters

func (this *BackendsBandwidthCounter) UpdateCounters(targets []core.Target)

*

  • Update counters to match targets, optionally creating new
  • and deleting old counters

type BandwidthCounter

type BandwidthCounter struct {

	/* Bandwidth Stats */
	BandwidthStats

	/* Last received total bytes */
	RxTotalLast uint64
	/* Last transmitted total bytes */
	TxTotalLast uint64

	/* Input channel for bandwidth deltas */
	Traffic chan core.ReadWriteCount

	/* Output channel for bandwidth stats */
	Out chan BandwidthStats
	// contains filtered or unexported fields
}

*

  • Count total bandwidth and bandwidth per second

func NewBandwidthCounter

func NewBandwidthCounter(interval time.Duration, out chan BandwidthStats) *BandwidthCounter

*

  • Create new BandwidthCounter

func (*BandwidthCounter) Start

func (this *BandwidthCounter) Start()

*

  • Starts bandwidth counter

func (*BandwidthCounter) Stop

func (this *BandwidthCounter) Stop()

*

  • Stops bandwidth counter

type BandwidthStats

type BandwidthStats struct {

	// Total received bytes
	RxTotal uint64

	// Total transmitted bytes
	TxTotal uint64

	// Received bytes per second
	RxSecond uint

	// Transmitted bytes per second
	TxSecond uint

	// Optional target of stats
	Target core.Target
}

*

  • Bandwidth stats object

Jump to

Keyboard shortcuts

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