From 7fdcbce1f1e7791634c98d058fa7c6227bf1a6a4 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Thu, 12 Dec 2019 12:42:25 +0300 Subject: [PATCH] Change Reporter to BandwidthCounter in IpfsNode --- core/core.go | 20 ++++++++++---------- core/node/libp2p/transport.go | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/core.go b/core/core.go index 1d1424ab4..702b42b3a 100644 --- a/core/core.go +++ b/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 diff --git a/core/node/libp2p/transport.go b/core/node/libp2p/transport.go index 526776ab3..a08ec86c1 100644 --- a/core/node/libp2p/transport.go +++ b/core/node/libp2p/transport.go @@ -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