mirror of
				https://github.com/libp2p/go-libp2p.git
				synced 2025-10-31 11:56:37 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			533 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			533 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package metrics
 | |
| 
 | |
| import (
 | |
| 	protocol "github.com/ipfs/go-libp2p/p2p/protocol"
 | |
| 	peer "gx/ipfs/QmY1xNhBfF9xA1pmD8yejyQAyd77K68qNN6JPM1CN2eiRu/go-libp2p-peer"
 | |
| )
 | |
| 
 | |
| 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
 | |
| }
 | 
