aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/storage')
-rw-r--r--swarm/storage/ldbstore.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/swarm/storage/ldbstore.go b/swarm/storage/ldbstore.go
index b95aa13b0..bd3501ea2 100644
--- a/swarm/storage/ldbstore.go
+++ b/swarm/storage/ldbstore.go
@@ -49,6 +49,10 @@ const (
)
var (
+ dbEntryCount = metrics.NewRegisteredCounter("ldbstore.entryCnt", nil)
+)
+
+var (
keyIndex = byte(0)
keyOldData = byte(1)
keyAccessCnt = []byte{2}
@@ -495,6 +499,7 @@ func (s *LDBStore) delete(idx uint64, idxKey []byte, po uint8) {
batch.Delete(idxKey)
batch.Delete(getDataKey(idx, po))
s.entryCnt--
+ dbEntryCount.Dec(1)
s.bucketCnt[po]--
cntKey := make([]byte, 2)
cntKey[0] = keyDistanceCnt
@@ -566,6 +571,7 @@ func (s *LDBStore) doPut(chunk *Chunk, index *dpaDBIndex, po uint8) {
index.Idx = s.dataIdx
s.bucketCnt[po] = s.dataIdx
s.entryCnt++
+ dbEntryCount.Inc(1)
s.dataIdx++
cntKey := make([]byte, 2)