github.com/tsuna/gohbase@v0.0.0-20250731002811-4ffcadfba63e/region/prometheus.go (about)

     1  // Copyright (C) 2021  The GoHBase Authors.  All rights reserved.
     2  // This file is part of GoHBase.
     3  // Use of this source code is governed by the Apache License 2.0
     4  // that can be found in the COPYING file.
     5  
     6  package region
     7  
     8  import (
     9  	"github.com/prometheus/client_golang/prometheus"
    10  	"github.com/prometheus/client_golang/prometheus/promauto"
    11  )
    12  
    13  var (
    14  	flushReasonCount = promauto.NewCounterVec(
    15  		prometheus.CounterOpts{
    16  			Namespace: "gohbase",
    17  			Name:      "batch_flush_count",
    18  			Help:      "Number of times a gohbase batch was flushed",
    19  		},
    20  		[]string{"reason"},
    21  	)
    22  
    23  	flushSize = promauto.NewHistogramVec(
    24  		prometheus.HistogramOpts{
    25  			Namespace: "gohbase",
    26  			Name:      "batch_flush_size",
    27  			Help:      "Number of RPCs sent in multis",
    28  			Buckets:   prometheus.ExponentialBuckets(1, 5, 8),
    29  		},
    30  		[]string{"regionserver"},
    31  	)
    32  
    33  	rpcSize = promauto.NewHistogramVec(
    34  		prometheus.HistogramOpts{
    35  			Namespace: "gohbase",
    36  			Name:      "rpc_size_bytes",
    37  			Help:      "Number of bytes sent per RPC call to HBase",
    38  			// >>> [1024*(4**i) for i in range(8)]
    39  			// [1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216]
    40  			Buckets: prometheus.ExponentialBuckets(1024, 4, 8),
    41  		},
    42  		[]string{"regionserver"},
    43  	)
    44  )