forked from TrueCloudLab/frostfs-node
[#725] writecache: Fix metric values
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
121f5c4dd8
commit
d4b6ebe7e7
11 changed files with 19 additions and 31 deletions
|
@ -10,16 +10,10 @@ import (
|
|||
|
||||
type WriteCacheMetrics interface {
|
||||
AddMethodDuration(shardID string, method string, success bool, d time.Duration, storageType string)
|
||||
|
||||
IncActualCount(shardID string, storageType string)
|
||||
DecActualCount(shardID string, storageType string)
|
||||
SetActualCount(shardID string, count uint64, storageType string)
|
||||
|
||||
SetEstimateSize(shardID string, size uint64, storageType string)
|
||||
SetMode(shardID string, mode string)
|
||||
|
||||
IncOperationCounter(shardID string, operation string, success NullBool, storageType string)
|
||||
|
||||
Close(shardID string)
|
||||
}
|
||||
|
||||
|
@ -65,20 +59,6 @@ func (m *writeCacheMetrics) AddMethodDuration(shardID string, method string, suc
|
|||
).Observe(d.Seconds())
|
||||
}
|
||||
|
||||
func (m *writeCacheMetrics) IncActualCount(shardID string, storageType string) {
|
||||
m.actualCount.With(prometheus.Labels{
|
||||
shardIDLabel: shardID,
|
||||
storageLabel: storageType,
|
||||
}).Inc()
|
||||
}
|
||||
|
||||
func (m *writeCacheMetrics) DecActualCount(shardID string, storageType string) {
|
||||
m.actualCount.With(prometheus.Labels{
|
||||
shardIDLabel: shardID,
|
||||
storageLabel: storageType,
|
||||
}).Dec()
|
||||
}
|
||||
|
||||
func (m *writeCacheMetrics) SetActualCount(shardID string, count uint64, storageType string) {
|
||||
m.actualCount.With(prometheus.Labels{
|
||||
shardIDLabel: shardID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue