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
Click to show internal directories.
Click to hide internal directories.