forked from TrueCloudLab/frostfs-node
[#602] metrics: Add blobovnicza items counter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
c4e1d8eb07
commit
f2811f8585
8 changed files with 70 additions and 18 deletions
|
@ -18,6 +18,9 @@ type BlobobvnizcaMetrics interface {
|
|||
AddOpenBlobovniczaSize(shardID, path string, size uint64)
|
||||
SubOpenBlobovniczaSize(shardID, path string, size uint64)
|
||||
|
||||
AddOpenBlobovniczaItems(shardID, path string, items uint64)
|
||||
SubOpenBlobovniczaItems(shardID, path string, items uint64)
|
||||
|
||||
IncOpenBlobovniczaCount(shardID, path string)
|
||||
DecOpenBlobovniczaCount(shardID, path string)
|
||||
}
|
||||
|
@ -28,6 +31,7 @@ type blobovnicza struct {
|
|||
treePut *prometheus.CounterVec
|
||||
treeGet *prometheus.CounterVec
|
||||
treeOpenSize *prometheus.GaugeVec
|
||||
treeOpenItems *prometheus.GaugeVec
|
||||
treeOpenCounter *prometheus.GaugeVec
|
||||
}
|
||||
|
||||
|
@ -59,6 +63,12 @@ func newBlobovnicza() *blobovnicza {
|
|||
Name: "open_blobovnicza_size_bytes",
|
||||
Help: "Size of opened blobovniczas of Blobovnicza tree",
|
||||
}, []string{shardIDLabel, pathLabel}),
|
||||
treeOpenItems: metrics.NewGaugeVec(prometheus.GaugeOpts{
|
||||
Namespace: namespace,
|
||||
Subsystem: blobovniczaTreeSubSystem,
|
||||
Name: "open_blobovnicza_items_total",
|
||||
Help: "Count of items in opened blobovniczas of Blobovnicza tree",
|
||||
}, []string{shardIDLabel, pathLabel}),
|
||||
treeOpenCounter: metrics.NewGaugeVec(prometheus.GaugeOpts{
|
||||
Namespace: namespace,
|
||||
Subsystem: blobovniczaTreeSubSystem,
|
||||
|
@ -139,3 +149,17 @@ func (b *blobovnicza) DecOpenBlobovniczaCount(shardID, path string) {
|
|||
pathLabel: path,
|
||||
}).Dec()
|
||||
}
|
||||
|
||||
func (b *blobovnicza) AddOpenBlobovniczaItems(shardID, path string, items uint64) {
|
||||
b.treeOpenItems.With(prometheus.Labels{
|
||||
shardIDLabel: shardID,
|
||||
pathLabel: path,
|
||||
}).Add(float64(items))
|
||||
}
|
||||
|
||||
func (b *blobovnicza) SubOpenBlobovniczaItems(shardID, path string, items uint64) {
|
||||
b.treeOpenItems.With(prometheus.Labels{
|
||||
shardIDLabel: shardID,
|
||||
pathLabel: path,
|
||||
}).Sub(float64(items))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue