@@ -62,117 +62,99 @@ type metrics struct {
62
62
priorStats , currentStats * leveldb.DBStats
63
63
}
64
64
65
- func newMetrics (namespace string , reg prometheus.Registerer ) (metrics , error ) {
65
+ func newMetrics (reg prometheus.Registerer ) (metrics , error ) {
66
66
m := metrics {
67
67
writesDelayedCount : prometheus .NewCounter (prometheus.CounterOpts {
68
- Namespace : namespace ,
69
- Name : "writes_delayed" ,
70
- Help : "number of cumulative writes that have been delayed due to compaction" ,
68
+ Name : "writes_delayed" ,
69
+ Help : "number of cumulative writes that have been delayed due to compaction" ,
71
70
}),
72
71
writesDelayedDuration : prometheus .NewGauge (prometheus.GaugeOpts {
73
- Namespace : namespace ,
74
- Name : "writes_delayed_duration" ,
75
- Help : "amount of time (in ns) that writes have been delayed due to compaction" ,
72
+ Name : "writes_delayed_duration" ,
73
+ Help : "amount of time (in ns) that writes have been delayed due to compaction" ,
76
74
}),
77
75
writeIsDelayed : prometheus .NewGauge (prometheus.GaugeOpts {
78
- Namespace : namespace ,
79
- Name : "write_delayed" ,
80
- Help : "1 if there is currently a write that is being delayed due to compaction" ,
76
+ Name : "write_delayed" ,
77
+ Help : "1 if there is currently a write that is being delayed due to compaction" ,
81
78
}),
82
79
83
80
aliveSnapshots : prometheus .NewGauge (prometheus.GaugeOpts {
84
- Namespace : namespace ,
85
- Name : "alive_snapshots" ,
86
- Help : "number of currently alive snapshots" ,
81
+ Name : "alive_snapshots" ,
82
+ Help : "number of currently alive snapshots" ,
87
83
}),
88
84
aliveIterators : prometheus .NewGauge (prometheus.GaugeOpts {
89
- Namespace : namespace ,
90
- Name : "alive_iterators" ,
91
- Help : "number of currently alive iterators" ,
85
+ Name : "alive_iterators" ,
86
+ Help : "number of currently alive iterators" ,
92
87
}),
93
88
94
89
ioWrite : prometheus .NewCounter (prometheus.CounterOpts {
95
- Namespace : namespace ,
96
- Name : "io_write" ,
97
- Help : "cumulative amount of io write during compaction" ,
90
+ Name : "io_write" ,
91
+ Help : "cumulative amount of io write during compaction" ,
98
92
}),
99
93
ioRead : prometheus .NewCounter (prometheus.CounterOpts {
100
- Namespace : namespace ,
101
- Name : "io_read" ,
102
- Help : "cumulative amount of io read during compaction" ,
94
+ Name : "io_read" ,
95
+ Help : "cumulative amount of io read during compaction" ,
103
96
}),
104
97
105
98
blockCacheSize : prometheus .NewGauge (prometheus.GaugeOpts {
106
- Namespace : namespace ,
107
- Name : "block_cache_size" ,
108
- Help : "total size of cached blocks" ,
99
+ Name : "block_cache_size" ,
100
+ Help : "total size of cached blocks" ,
109
101
}),
110
102
openTables : prometheus .NewGauge (prometheus.GaugeOpts {
111
- Namespace : namespace ,
112
- Name : "open_tables" ,
113
- Help : "number of currently opened tables" ,
103
+ Name : "open_tables" ,
104
+ Help : "number of currently opened tables" ,
114
105
}),
115
106
116
107
levelTableCount : prometheus .NewGaugeVec (
117
108
prometheus.GaugeOpts {
118
- Namespace : namespace ,
119
- Name : "table_count" ,
120
- Help : "number of tables allocated by level" ,
109
+ Name : "table_count" ,
110
+ Help : "number of tables allocated by level" ,
121
111
},
122
112
levelLabels ,
123
113
),
124
114
levelSize : prometheus .NewGaugeVec (
125
115
prometheus.GaugeOpts {
126
- Namespace : namespace ,
127
- Name : "size" ,
128
- Help : "amount of bytes allocated by level" ,
116
+ Name : "size" ,
117
+ Help : "amount of bytes allocated by level" ,
129
118
},
130
119
levelLabels ,
131
120
),
132
121
levelDuration : prometheus .NewGaugeVec (
133
122
prometheus.GaugeOpts {
134
- Namespace : namespace ,
135
- Name : "duration" ,
136
- Help : "amount of time (in ns) spent in compaction by level" ,
123
+ Name : "duration" ,
124
+ Help : "amount of time (in ns) spent in compaction by level" ,
137
125
},
138
126
levelLabels ,
139
127
),
140
128
levelReads : prometheus .NewCounterVec (
141
129
prometheus.CounterOpts {
142
- Namespace : namespace ,
143
- Name : "reads" ,
144
- Help : "amount of bytes read during compaction by level" ,
130
+ Name : "reads" ,
131
+ Help : "amount of bytes read during compaction by level" ,
145
132
},
146
133
levelLabels ,
147
134
),
148
135
levelWrites : prometheus .NewCounterVec (
149
136
prometheus.CounterOpts {
150
- Namespace : namespace ,
151
- Name : "writes" ,
152
- Help : "amount of bytes written during compaction by level" ,
137
+ Name : "writes" ,
138
+ Help : "amount of bytes written during compaction by level" ,
153
139
},
154
140
levelLabels ,
155
141
),
156
142
157
143
memCompactions : prometheus .NewCounter (prometheus.CounterOpts {
158
- Namespace : namespace ,
159
- Name : "mem_comps" ,
160
- Help : "total number of memory compactions performed" ,
144
+ Name : "mem_comps" ,
145
+ Help : "total number of memory compactions performed" ,
161
146
}),
162
147
level0Compactions : prometheus .NewCounter (prometheus.CounterOpts {
163
- Namespace : namespace ,
164
- Name : "level_0_comps" ,
165
- Help : "total number of level 0 compactions performed" ,
148
+ Name : "level_0_comps" ,
149
+ Help : "total number of level 0 compactions performed" ,
166
150
}),
167
151
nonLevel0Compactions : prometheus .NewCounter (prometheus.CounterOpts {
168
- Namespace : namespace ,
169
- Name : "non_level_0_comps" ,
170
- Help : "total number of non-level 0 compactions performed" ,
152
+ Name : "non_level_0_comps" ,
153
+ Help : "total number of non-level 0 compactions performed" ,
171
154
}),
172
155
seekCompactions : prometheus .NewCounter (prometheus.CounterOpts {
173
- Namespace : namespace ,
174
- Name : "seek_comps" ,
175
- Help : "total number of seek compactions performed" ,
156
+ Name : "seek_comps" ,
157
+ Help : "total number of seek compactions performed" ,
176
158
}),
177
159
178
160
priorStats : & leveldb.DBStats {},
0 commit comments