mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-24 20:07:45 +08:00
Merge pull request #6793 from kpp/reporter_to_counter
Change Reporter to BandwidthCounter in IpfsNode
This commit is contained in:
commit
a1b492b8ea
20
core/core.go
20
core/core.go
@ -67,16 +67,16 @@ type IpfsNode struct {
|
||||
PNetFingerprint libp2p.PNetFingerprint `optional:"true"` // fingerprint of private network
|
||||
|
||||
// Services
|
||||
Peerstore pstore.Peerstore `optional:"true"` // storage for other Peer instances
|
||||
Blockstore bstore.GCBlockstore // the block store (lower level)
|
||||
Filestore *filestore.Filestore `optional:"true"` // the filestore blockstore
|
||||
BaseBlocks node.BaseBlocks // the raw blockstore, no filestore wrapping
|
||||
GCLocker bstore.GCLocker // the locker used to protect the blockstore during gc
|
||||
Blocks bserv.BlockService // the block service, get/add blocks.
|
||||
DAG ipld.DAGService // the merkle dag service, get/add objects.
|
||||
Resolver *resolver.Resolver // the path resolution system
|
||||
Reporter metrics.Reporter `optional:"true"`
|
||||
Discovery discovery.Service `optional:"true"`
|
||||
Peerstore pstore.Peerstore `optional:"true"` // storage for other Peer instances
|
||||
Blockstore bstore.GCBlockstore // the block store (lower level)
|
||||
Filestore *filestore.Filestore `optional:"true"` // the filestore blockstore
|
||||
BaseBlocks node.BaseBlocks // the raw blockstore, no filestore wrapping
|
||||
GCLocker bstore.GCLocker // the locker used to protect the blockstore during gc
|
||||
Blocks bserv.BlockService // the block service, get/add blocks.
|
||||
DAG ipld.DAGService // the merkle dag service, get/add objects.
|
||||
Resolver *resolver.Resolver // the path resolution system
|
||||
Reporter *metrics.BandwidthCounter `optional:"true"`
|
||||
Discovery discovery.Service `optional:"true"`
|
||||
FilesRoot *mfs.Root
|
||||
RecordValidator record.Validator
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ func Security(enabled, preferTLS bool) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
func BandwidthCounter() (opts Libp2pOpts, reporter metrics.Reporter) {
|
||||
func BandwidthCounter() (opts Libp2pOpts, reporter *metrics.BandwidthCounter) {
|
||||
reporter = metrics.NewBandwidthCounter()
|
||||
opts.Opts = append(opts.Opts, libp2p.BandwidthReporter(reporter))
|
||||
return opts, reporter
|
||||
|
||||
Loading…
Reference in New Issue
Block a user