mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 22:49:13 +08:00

humanize bandwidth output instrument conn.Conn for bandwidth metrics add poll command for continuous bandwidth reporting move bandwidth tracking onto multiaddr net connections another mild refactor of recording locations address concerns from PR lower mock nodes in race test due to increased goroutines per connection
20 lines
494 B
Go
20 lines
494 B
Go
package metrics
|
|
|
|
import (
|
|
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
protocol "github.com/ipfs/go-ipfs/p2p/protocol"
|
|
)
|
|
|
|
type StreamMeterCallback func(int64, protocol.ID, peer.ID)
|
|
type MeterCallback func(int64)
|
|
|
|
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
|
|
}
|