github.com/ari-anchor/sei-tendermint@v0.0.0-20230519144642-dc826b7b56bb/internal/state/metrics.gen.go (about)

     1  // Code generated by metricsgen. DO NOT EDIT.
     2  
     3  package state
     4  
     5  import (
     6  	"github.com/go-kit/kit/metrics/discard"
     7  	prometheus "github.com/go-kit/kit/metrics/prometheus"
     8  	stdprometheus "github.com/prometheus/client_golang/prometheus"
     9  )
    10  
    11  func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics {
    12  	labels := []string{}
    13  	for i := 0; i < len(labelsAndValues); i += 2 {
    14  		labels = append(labels, labelsAndValues[i])
    15  	}
    16  	return &Metrics{
    17  		BlockProcessingTime: prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{
    18  			Namespace: namespace,
    19  			Subsystem: MetricsSubsystem,
    20  			Name:      "block_processing_time",
    21  			Help:      "Time between BeginBlock and EndBlock.",
    22  
    23  			Buckets: stdprometheus.ExponentialBucketsRange(0.01, 10, 10),
    24  		}, labels).With(labelsAndValues...),
    25  		ConsensusParamUpdates: prometheus.NewCounterFrom(stdprometheus.CounterOpts{
    26  			Namespace: namespace,
    27  			Subsystem: MetricsSubsystem,
    28  			Name:      "consensus_param_updates",
    29  			Help:      "Number of consensus parameter updates returned by the application since process start.",
    30  		}, labels).With(labelsAndValues...),
    31  		ValidatorSetUpdates: prometheus.NewCounterFrom(stdprometheus.CounterOpts{
    32  			Namespace: namespace,
    33  			Subsystem: MetricsSubsystem,
    34  			Name:      "validator_set_updates",
    35  			Help:      "Number of validator set updates returned by the application since process start.",
    36  		}, labels).With(labelsAndValues...),
    37  		FlushAppConnectionTime: prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{
    38  			Namespace: namespace,
    39  			Subsystem: MetricsSubsystem,
    40  			Name:      "flush_app_connection_time",
    41  			Help:      "ValidatorSetUpdates measures how long it takes async ABCI requests to be flushed before committing application state",
    42  		}, labels).With(labelsAndValues...),
    43  		ApplicationCommitTime: prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{
    44  			Namespace: namespace,
    45  			Subsystem: MetricsSubsystem,
    46  			Name:      "application_commit_time",
    47  			Help:      "ApplicationCommitTime meaures how long it takes to commit application state",
    48  		}, labels).With(labelsAndValues...),
    49  		UpdateMempoolTime: prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{
    50  			Namespace: namespace,
    51  			Subsystem: MetricsSubsystem,
    52  			Name:      "update_mempool_time",
    53  			Help:      "UpdateMempoolTime meaures how long it takes to update mempool after commiting, including reCheckTx",
    54  		}, labels).With(labelsAndValues...),
    55  	}
    56  }
    57  
    58  func NopMetrics() *Metrics {
    59  	return &Metrics{
    60  		BlockProcessingTime:    discard.NewHistogram(),
    61  		ConsensusParamUpdates:  discard.NewCounter(),
    62  		ValidatorSetUpdates:    discard.NewCounter(),
    63  		FlushAppConnectionTime: discard.NewHistogram(),
    64  		ApplicationCommitTime:  discard.NewHistogram(),
    65  		UpdateMempoolTime:      discard.NewHistogram(),
    66  	}
    67  }