Documentation ¶
Index ¶
- func NewExponentMetric(interval int, meanTime int) *exponentMetric
- func NewMetricManager(interval int) *metricsManager
- type DataMetric
- type MetricsManager
- type PeerMetric
- func (m *PeerMetric) InputAdded(added int)
- func (m *PeerMetric) OnRead(protocol p2pcommon.SubProtocol, read int)
- func (m *PeerMetric) OnWrite(protocol p2pcommon.SubProtocol, write int)
- func (m *PeerMetric) OutputAdded(added int)
- func (m *PeerMetric) TotalIn() int64
- func (m *PeerMetric) TotalOut() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExponentMetric ¶
func NewMetricManager ¶
func NewMetricManager(interval int) *metricsManager
Types ¶
type DataMetric ¶
type DataMetric interface { // APS shows average bytes per second in a given period APS() int64 // LoadScore is calulated value of network load. LoadScore() int64 // add bytes transferred AddBytes(byteSize int) // Calculate should be called peridically with exact interval and a single thread Calculate() }
DataMetric hold data transfer of a peer. It shows eventually consistent aps and load score.
func NewExponentMetric15 ¶
func NewExponentMetric15(tickInterval int) DataMetric
NewExponentMetric15
func NewExponentMetric5 ¶
func NewExponentMetric5(tickInterval int) DataMetric
type MetricsManager ¶
type MetricsManager interface { Start() Stop() NewMetric(pid types.PeerID, manNum uint32) *PeerMetric Remove(pid types.PeerID, manNum uint32) *PeerMetric Metric(pid types.PeerID) (*PeerMetric, bool) Metrics() []*PeerMetric Summary() map[string]interface{} PrintMetrics() string }
type PeerMetric ¶
type PeerMetric struct { PeerID types.PeerID Since time.Time InMetric DataMetric OutMetric DataMetric // contains filtered or unexported fields }
func (*PeerMetric) OnRead ¶
func (m *PeerMetric) OnRead(protocol p2pcommon.SubProtocol, read int)
func (*PeerMetric) OnWrite ¶
func (m *PeerMetric) OnWrite(protocol p2pcommon.SubProtocol, write int)
func (*PeerMetric) TotalIn ¶
func (m *PeerMetric) TotalIn() int64
func (*PeerMetric) TotalOut ¶
func (m *PeerMetric) TotalOut() int64
Click to show internal directories.
Click to hide internal directories.