blob: 864fa1609a0e835f2d090243e3841763ad9ea395 [file] [log] [blame]
khenaidooffe076b2019-01-15 16:08:08 -05001// Copyright 2016 The etcd Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package grpcproxy
16
17import "github.com/prometheus/client_golang/prometheus"
18
19var (
20 watchersCoalescing = prometheus.NewGauge(prometheus.GaugeOpts{
21 Namespace: "etcd",
22 Subsystem: "grpc_proxy",
23 Name: "watchers_coalescing_total",
24 Help: "Total number of current watchers coalescing",
25 })
26 eventsCoalescing = prometheus.NewCounter(prometheus.CounterOpts{
27 Namespace: "etcd",
28 Subsystem: "grpc_proxy",
29 Name: "events_coalescing_total",
30 Help: "Total number of events coalescing",
31 })
32 cacheKeys = prometheus.NewGauge(prometheus.GaugeOpts{
33 Namespace: "etcd",
34 Subsystem: "grpc_proxy",
35 Name: "cache_keys_total",
36 Help: "Total number of keys/ranges cached",
37 })
38 cacheHits = prometheus.NewGauge(prometheus.GaugeOpts{
39 Namespace: "etcd",
40 Subsystem: "grpc_proxy",
41 Name: "cache_hits_total",
42 Help: "Total number of cache hits",
43 })
44 cachedMisses = prometheus.NewGauge(prometheus.GaugeOpts{
45 Namespace: "etcd",
46 Subsystem: "grpc_proxy",
47 Name: "cache_misses_total",
48 Help: "Total number of cache misses",
49 })
50)
51
52func init() {
53 prometheus.MustRegister(watchersCoalescing)
54 prometheus.MustRegister(eventsCoalescing)
55 prometheus.MustRegister(cacheKeys)
56 prometheus.MustRegister(cacheHits)
57 prometheus.MustRegister(cachedMisses)
58}