add apis and command to inspect bandwidth usage

This commit is contained in:
whyrusleeping
2020-09-02 15:25:53 -07:00
parent b774563ec3
commit a59dadccc9
7 changed files with 147 additions and 8 deletions
+2
View File
@@ -86,6 +86,7 @@ var (
NatPortMapKey = special{8} // Libp2p option
ConnectionManagerKey = special{9} // Libp2p option
AutoNATSvcKey = special{10} // Libp2p option
BandwidthReporterKey = special{11} // Libp2p option
)
type invoke int
@@ -181,6 +182,7 @@ func libp2p() Option {
Override(new(routing.Routing), lp2p.Routing),
Override(NatPortMapKey, lp2p.NatPortMap),
Override(BandwidthReporterKey, lp2p.BandwidthCounter),
Override(ConnectionManagerKey, lp2p.ConnectionManager(50, 200, 20*time.Second, nil)),
Override(AutoNATSvcKey, lp2p.AutoNATService),