forked from TrueCloudLab/frostfs-node
[#376] metrics: Add GC metrics
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
faca861451
commit
3220c4df9f
7 changed files with 244 additions and 26 deletions
|
@ -28,6 +28,7 @@ type MetricRegister interface {
|
|||
AddToPayloadCounter(shardID string, size int64)
|
||||
|
||||
WriteCache() metrics.WriteCacheMetrics
|
||||
GC() metrics.GCMetrics
|
||||
}
|
||||
|
||||
func elapsed(addFunc func(d time.Duration)) func() {
|
||||
|
@ -37,3 +38,24 @@ func elapsed(addFunc func(d time.Duration)) func() {
|
|||
addFunc(time.Since(t))
|
||||
}
|
||||
}
|
||||
|
||||
type gcMetrics struct {
|
||||
storage metrics.GCMetrics
|
||||
shardID string
|
||||
}
|
||||
|
||||
func (m *gcMetrics) AddRunDuration(d time.Duration, success bool) {
|
||||
m.storage.AddRunDuration(m.shardID, d, success)
|
||||
}
|
||||
|
||||
func (m *gcMetrics) AddDeletedCount(deleted, failed uint64) {
|
||||
m.storage.AddDeletedCount(m.shardID, deleted, failed)
|
||||
}
|
||||
|
||||
func (m *gcMetrics) AddExpiredObjectCollectionDuration(d time.Duration, success bool, objectType string) {
|
||||
m.storage.AddExpiredObjectCollectionDuration(m.shardID, d, success, objectType)
|
||||
}
|
||||
|
||||
func (m *gcMetrics) AddInhumedObjectCount(count uint64, objectType string) {
|
||||
m.storage.AddInhumedObjectCount(m.shardID, count, objectType)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue