Documentation ¶
Index ¶
- func NewECRate(alpha float64) *etherCopyRate
- func NewECRate5(tickInterval int) *etherCopyRate
- func NewExponentMetric(interval int, meanTime int) *exponentMetric
- func NewMetricManager(interval int) *metricsManager
- type DataMetric
- type ListenAdded
- type MetricReader
- type MetricWriter
- type MetricsManager
- type PeerMetric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewECRate5 ¶
func NewECRate5(tickInterval int) *etherCopyRate
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 ListenAdded ¶
type ListenAdded func(size int)
type MetricReader ¶
type MetricReader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(rd io.Reader) *MetricReader
func (*MetricReader) AddListener ¶
func (r *MetricReader) AddListener(listener ListenAdded)
type MetricWriter ¶
type MetricWriter struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func NewWriter(wt io.Writer) *MetricWriter
func (*MetricWriter) AddListener ¶
func (w *MetricWriter) AddListener(listener ListenAdded)
type MetricsManager ¶
type MetricsManager interface { Start() Stop() Add(pid peer.ID, reader *MetricReader, writer *MetricWriter) *PeerMetric Remove(pid peer.ID) *PeerMetric Metric(pid peer.ID) (*PeerMetric, bool) Metrics() []*PeerMetric Summary() string }
type PeerMetric ¶
type PeerMetric struct { PeerID peer.ID Since time.Time InMetric DataMetric OutMetric DataMetric // contains filtered or unexported fields }
func (*PeerMetric) InputAdded ¶
func (m *PeerMetric) InputAdded(added int)
func (*PeerMetric) OutputAdded ¶
func (m *PeerMetric) OutputAdded(added 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.