diff --git a/ethdb/leveldb/leveldb.go b/ethdb/leveldb/leveldb.go index e58efbddbe..c0e0eb250a 100644 --- a/ethdb/leveldb/leveldb.go +++ b/ethdb/leveldb/leveldb.go @@ -22,7 +22,6 @@ package leveldb import ( "fmt" - "strings" "sync" "time" @@ -246,11 +245,6 @@ func (db *Database) NewSnapshot() (ethdb.Snapshot, error) { // Stat returns a particular internal stat of the database. func (db *Database) Stat(property string) (string, error) { - if property == "" { - property = "leveldb.stats" - } else if !strings.HasPrefix(property, "leveldb.") { - property = "leveldb." + property - } return db.db.GetProperty(property) } diff --git a/ethdb/pebble/pebble.go b/ethdb/pebble/pebble.go index c35a154cac..12a84cc91a 100644 --- a/ethdb/pebble/pebble.go +++ b/ethdb/pebble/pebble.go @@ -379,12 +379,9 @@ func upperBound(prefix []byte) (limit []byte) { return limit } -// Stat returns the internal metrics of Pebble in a text format. It's a developer -// method to read everything there is to read independent of Pebble version. -// -// The property is unused in Pebble as there's only one thing to retrieve. +// Stat returns a particular internal stat of the database. func (d *Database) Stat(property string) (string, error) { - return d.db.Metrics().String(), nil + return "", nil } // Compact flattens the underlying data store for the given key range. In essence, diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index d22424502c..f7584cbf5a 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -2191,6 +2191,11 @@ func (api *DebugAPI) PrintBlock(ctx context.Context, number uint64) (string, err // ChaindbProperty returns leveldb properties of the key-value database. func (api *DebugAPI) ChaindbProperty(property string) (string, error) { + if property == "" { + property = "leveldb.stats" + } else if !strings.HasPrefix(property, "leveldb.") { + property = "leveldb." + property + } return api.b.ChainDb().Stat(property) }