Commit a8330f1f authored by Jeromy's avatar Jeromy Committed by Juan Batiz-Benet

add methods on net interface to retrieve bandwidth values

parent afe85ce1
......@@ -29,6 +29,10 @@ type Network interface {
// GetPeerList returns the list of peers currently connected in this network.
GetPeerList() []*peer.Peer
// GetBandwidthTotals returns the total number of bytes passed through
// the network since it was instantiated
GetBandwidthTotals() (uint64, uint64)
// SendMessage sends given Message out
SendMessage(msg.NetMessage) error
......
......@@ -111,3 +111,7 @@ func (n *IpfsNetwork) Close() error {
func (n *IpfsNetwork) GetPeerList() []*peer.Peer {
return n.swarm.GetPeerList()
}
func (n *IpfsNetwork) GetBandwidthTotals() (in uint64, out uint64) {
return n.muxer.GetBandwidthTotals()
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment