forked from coreos/torus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.go
69 lines (65 loc) · 2.87 KB
/
common.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// storage is the package which implements the underlying, on-disk storage
// API for Torus servers. A single node can be tested with just a storage
// implementation, but the distributor replaces it as a virtual implementation
// of a much larger storage pool, provided by the cluster. This is storage
// underneath a single node.
package storage
import (
"github.com/coreos/pkg/capnslog"
"github.com/prometheus/client_golang/prometheus"
)
var clog = capnslog.NewPackageLogger("github.com/coreos/torus", "storage")
var (
promBlocks = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "torus_storage_blocks",
Help: "Gauge of number of blocks in local storage",
}, []string{"storage"})
promBlocksAvail = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "torus_storage_blocks_total",
Help: "Gauge of number of blocks available in local storage",
}, []string{"storage"})
promBlocksRetrieved = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "torus_storage_read_blocks",
Help: "Number of blocks returned from local block storage",
}, []string{"storage"})
promBlocksFailed = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "torus_storage_failed_blocks",
Help: "Number of blocks failed to be returned from local block storage",
}, []string{"storage"})
promBlocksWritten = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "torus_storage_written_blocks",
Help: "Number of blocks written to local block storage",
}, []string{"storage"})
promBlockWritesFailed = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "torus_storage_failed_written_blocks",
Help: "Number of blocks failed to be written to local block storage",
}, []string{"storage"})
promBlocksDeleted = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "torus_storage_deleted_blocks",
Help: "Number of blocks deleted from local block storage",
}, []string{"storage"})
promBlockDeletesFailed = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "torus_storage_failed_deleted_blocks",
Help: "Number of blocks failed to be deleted from local block storage",
}, []string{"storage"})
promStorageFlushes = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "torus_storage_flushes",
Help: "Number of times the storage layer is synced to disk",
}, []string{"storage"})
promBytesPerBlock = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "torus_storage_block_bytes",
Help: "Number of bytes per block in the storage layer",
})
)
func init() {
prometheus.MustRegister(promBlocks)
prometheus.MustRegister(promBlocksAvail)
prometheus.MustRegister(promBlocksRetrieved)
prometheus.MustRegister(promBlocksFailed)
prometheus.MustRegister(promBlocksWritten)
prometheus.MustRegister(promBlockWritesFailed)
prometheus.MustRegister(promBlocksDeleted)
prometheus.MustRegister(promBlockDeletesFailed)
prometheus.MustRegister(promStorageFlushes)
prometheus.MustRegister(promBytesPerBlock)
}