github.com/kaituanwang/hyperledger@v2.0.1+incompatible/core/container/dockercontroller/metrics.go (about)

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package dockercontroller
     8  
     9  import "github.com/hyperledger/fabric/common/metrics"
    10  
    11  var (
    12  	chaincodeImageBuildDuration = metrics.HistogramOpts{
    13  		Namespace:    "dockercontroller",
    14  		Name:         "chaincode_container_build_duration",
    15  		Help:         "The time to build a chaincode image in seconds.",
    16  		LabelNames:   []string{"chaincode", "success"},
    17  		StatsdFormat: "%{#fqname}.%{chaincode}.%{success}",
    18  	}
    19  )
    20  
    21  type BuildMetrics struct {
    22  	ChaincodeImageBuildDuration metrics.Histogram
    23  }
    24  
    25  func NewBuildMetrics(p metrics.Provider) *BuildMetrics {
    26  	return &BuildMetrics{
    27  		ChaincodeImageBuildDuration: p.NewHistogram(chaincodeImageBuildDuration),
    28  	}
    29  }