github.com/anjalikarhana/fabric@v2.1.1+incompatible/orderer/common/blockcutter/metrics.go (about)

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package blockcutter
     8  
     9  import "github.com/hyperledger/fabric/common/metrics"
    10  
    11  var (
    12  	blockFillDuration = metrics.HistogramOpts{
    13  		Namespace:    "blockcutter",
    14  		Name:         "block_fill_duration",
    15  		Help:         "The time from first transaction enqueing to the block being cut in seconds.",
    16  		LabelNames:   []string{"channel"},
    17  		StatsdFormat: "%{#fqname}.%{channel}",
    18  	}
    19  )
    20  
    21  type Metrics struct {
    22  	BlockFillDuration metrics.Histogram
    23  }
    24  
    25  func NewMetrics(p metrics.Provider) *Metrics {
    26  	return &Metrics{
    27  		BlockFillDuration: p.NewHistogram(blockFillDuration),
    28  	}
    29  }