diff --git a/pkg/local_object_storage/shard/metrics_test.go b/pkg/local_object_storage/shard/metrics_test.go index 60adc072..91e158b0 100644 --- a/pkg/local_object_storage/shard/metrics_test.go +++ b/pkg/local_object_storage/shard/metrics_test.go @@ -28,13 +28,17 @@ type metricsStore struct { errCounter int64 } -func (m metricsStore) SetShardID(_ string) {} +func (m *metricsStore) SetShardID(_ string) {} -func (m metricsStore) SetObjectCounter(objectType string, v uint64) { +func (m *metricsStore) SetObjectCounter(objectType string, v uint64) { + m.mtx.Lock() + defer m.mtx.Unlock() m.objCounters[objectType] = v } -func (m metricsStore) AddToObjectCounter(objectType string, delta int) { +func (m *metricsStore) AddToObjectCounter(objectType string, delta int) { + m.mtx.Lock() + defer m.mtx.Unlock() switch { case delta > 0: m.objCounters[objectType] += uint64(delta)