metrics

package
v0.3.8-dev-trailers Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2015 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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