metrics

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BandwidthCounter

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

func NewBandwidthCounter

func NewBandwidthCounter() *BandwidthCounter

func (*BandwidthCounter) GetBandwidthForPeer

func (bwc *BandwidthCounter) GetBandwidthForPeer(p peer.ID) (out Stats)

func (*BandwidthCounter) GetBandwidthForProtocol

func (bwc *BandwidthCounter) GetBandwidthForProtocol(proto protocol.ID) (out Stats)

func (*BandwidthCounter) GetBandwidthTotals

func (bwc *BandwidthCounter) GetBandwidthTotals() (out Stats)

func (*BandwidthCounter) LogRecvMessage

func (bwc *BandwidthCounter) LogRecvMessage(size int64)

func (*BandwidthCounter) LogRecvMessageStream

func (bwc *BandwidthCounter) LogRecvMessageStream(size int64, proto protocol.ID, p peer.ID)

func (*BandwidthCounter) LogSentMessage

func (bwc *BandwidthCounter) LogSentMessage(size int64)

func (*BandwidthCounter) LogSentMessageStream

func (bwc *BandwidthCounter) LogSentMessageStream(size int64, proto protocol.ID, p peer.ID)

type MeterCallback

type MeterCallback func(int64)

type Reporter

type Reporter interface {
	LogSentMessage(int64)
	LogRecvMessage(int64)
	LogSentMessageStream(int64, protocol.ID, peer.ID)
	LogRecvMessageStream(int64, protocol.ID, peer.ID)
	GetBandwidthForPeer(peer.ID) Stats
	GetBandwidthForProtocol(protocol.ID) Stats
	GetBandwidthTotals() Stats
}

type Stats

type Stats struct {
	TotalIn  int64
	TotalOut int64
	RateIn   float64
	RateOut  float64
}

type StreamMeterCallback

type StreamMeterCallback func(int64, protocol.ID, peer.ID)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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