forked from tsuna/gohbase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prometheus.go
44 lines (39 loc) · 1.39 KB
/
prometheus.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (C) 2021 The GoHBase Authors. All rights reserved.
// This file is part of GoHBase.
// Use of this source code is governed by the Apache License 2.0
// that can be found in the COPYING file.
package gohbase
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
operationDurationSeconds = promauto.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "gohbase",
Name: "operation_duration_seconds",
Help: "Time in seconds for operation to complete",
// >>> [0.04*(2**i) for i in range(11)]
// [0.04, 0.08, 0.16, 0.32, 0.64, 1.28, 2.56, 5.12, 10.24, 20.48, 40.96]
// Meaning 40ms, 80ms, 160ms, 320ms, 640ms, 1.28s, ... max 40.96s
// (most requests have a 30s timeout by default at the Envoy level)
Buckets: prometheus.ExponentialBuckets(0.04, 2, 11),
},
[]string{"operation", "result"},
)
sendBatchSplitCount = promauto.NewHistogram(
prometheus.HistogramOpts{
Namespace: "gohbase",
Name: "sendbatch_split_count",
Help: "Count of Region Servers hit per SendBatch",
// 1, 2, 4, 8, 16, 32, 64, 128, 256, 512
Buckets: prometheus.ExponentialBuckets(1, 2, 10),
},
)
cachedRegionTotal = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "gohbase",
Subsystem: "cache",
Name: "regions_total",
Help: "Total number of regions in the cache",
})
)