From c8392d1b5c048300fd491861357316740660d159 Mon Sep 17 00:00:00 2001 From: Jiahao Huang Date: Sun, 23 Jun 2019 14:10:17 +0800 Subject: [PATCH] db.go: Don't skip some level we get LevelTablesCounts = [65,34], seems L0 file num is 65 after reopen db, LevelTablesCounts = [1,65,34] the origin LevelTablesCounts should be [0,65,34] if it skip some level, we have no any ideal what the Stat we get really means --- leveldb/db.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/leveldb/db.go b/leveldb/db.go index 0de5ffe8..42243397 100644 --- a/leveldb/db.go +++ b/leveldb/db.go @@ -1070,9 +1070,7 @@ func (db *DB) Stats(s *DBStats) error { for level, tables := range v.levels { duration, read, write := db.compStats.getStat(level) - if len(tables) == 0 && duration == 0 { - continue - } + s.LevelDurations = append(s.LevelDurations, duration) s.LevelRead = append(s.LevelRead, read) s.LevelWrite = append(s.LevelWrite, write)