Przeglądaj źródła

mvcc: set db size metric on restore

Fixes #8080
Anthony Romano 8 lat temu
rodzic
commit
ed7ef5be8b
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      mvcc/kvstore.go

+ 3 - 0
mvcc/kvstore.go

@@ -254,6 +254,9 @@ func (s *store) restore() error {
 	// restore index
 	// restore index
 	tx := s.b.BatchTx()
 	tx := s.b.BatchTx()
 	tx.Lock()
 	tx.Lock()
+
+	dbTotalSize.Set(float64(s.b.Size()))
+
 	_, finishedCompactBytes := tx.UnsafeRange(metaBucketName, finishedCompactKeyName, nil, 0)
 	_, finishedCompactBytes := tx.UnsafeRange(metaBucketName, finishedCompactKeyName, nil, 0)
 	if len(finishedCompactBytes) != 0 {
 	if len(finishedCompactBytes) != 0 {
 		s.compactMainRev = bytesToRev(finishedCompactBytes[0]).main
 		s.compactMainRev = bytesToRev(finishedCompactBytes[0]).main