From 7d0743422b1bc388b757dd096d3a7d3233b75873 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 23 Jul 2020 00:34:54 +0300 Subject: [PATCH] lib/storage: properly calculate global metrics in UpdateStats() --- lib/storage/partition.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/storage/partition.go b/lib/storage/partition.go index 56a30c8d8..8919e0dbe 100644 --- a/lib/storage/partition.go +++ b/lib/storage/partition.go @@ -367,11 +367,11 @@ func (pt *partition) UpdateMetrics(m *partitionMetrics) { pt.partsLock.Unlock() - m.BigIndexBlocksCacheRequests += atomic.LoadUint64(&historicalBigIndexBlocksCacheRequests) - m.BigIndexBlocksCacheMisses += atomic.LoadUint64(&historicalBigIndexBlocksCacheMisses) + m.BigIndexBlocksCacheRequests = atomic.LoadUint64(&historicalBigIndexBlocksCacheRequests) + m.BigIndexBlocksCacheMisses = atomic.LoadUint64(&historicalBigIndexBlocksCacheMisses) - m.SmallIndexBlocksCacheRequests += atomic.LoadUint64(&historicalSmallIndexBlocksCacheRequests) - m.SmallIndexBlocksCacheMisses += atomic.LoadUint64(&historicalSmallIndexBlocksCacheMisses) + m.SmallIndexBlocksCacheRequests = atomic.LoadUint64(&historicalSmallIndexBlocksCacheRequests) + m.SmallIndexBlocksCacheMisses = atomic.LoadUint64(&historicalSmallIndexBlocksCacheMisses) m.ActiveBigMerges += atomic.LoadUint64(&pt.activeBigMerges) m.ActiveSmallMerges += atomic.LoadUint64(&pt.activeSmallMerges)