github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/builder/config/metrics.go (about)

     1  package p2pbuilderconfig
     2  
     3  import (
     4  	"github.com/onflow/flow-go/module"
     5  	"github.com/onflow/flow-go/module/metrics"
     6  )
     7  
     8  // MetricsConfig is a wrapper around the metrics configuration for the libp2p node.
     9  // It is used to pass the metrics configuration to the libp2p node builder.
    10  type MetricsConfig struct {
    11  	// HeroCacheFactory is the factory for the HeroCache metrics. It is used to
    12  	// create a HeroCache metrics instance for each cache when needed. By passing
    13  	// the factory to the libp2p node builder, the libp2p node can create the
    14  	// HeroCache metrics instance for each cache internally, which reduces the
    15  	// number of arguments needed to be passed to the libp2p node builder.
    16  	HeroCacheFactory metrics.HeroCacheMetricsFactory
    17  
    18  	// LibP2PMetrics is the metrics instance for the libp2p node.
    19  	Metrics module.LibP2PMetrics
    20  }