github.com/lingyao2333/mo-zero@v1.4.1/core/stores/sqlx/metrics.go (about)

     1  package sqlx
     2  
     3  import "github.com/lingyao2333/mo-zero/core/metric"
     4  
     5  const namespace = "sql_client"
     6  
     7  var (
     8  	metricReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
     9  		Namespace: namespace,
    10  		Subsystem: "requests",
    11  		Name:      "duration_ms",
    12  		Help:      "mysql client requests duration(ms).",
    13  		Labels:    []string{"command"},
    14  		Buckets:   []float64{5, 10, 25, 50, 100, 250, 500, 1000, 2500},
    15  	})
    16  	metricReqErr = metric.NewCounterVec(&metric.CounterVecOpts{
    17  		Namespace: namespace,
    18  		Subsystem: "requests",
    19  		Name:      "error_total",
    20  		Help:      "mysql client requests error count.",
    21  		Labels:    []string{"command", "error"},
    22  	})
    23  )