interface.go 496 Bytes
Newer Older
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
1
2
3
package metrics

import (
Jeromy's avatar
Jeromy committed
4
	peer "github.com/ipfs/go-libp2p-peer"
5
	protocol "github.com/libp2p/go-libp2p/p2p/protocol"
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
)

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
}