Revert "ethdb, internal/ethapi: support exposing Pebble stats too, beside LevelDB (#28224)"

This reverts commit caf030e643.
This commit is contained in:
devopsbo3 2023-11-10 12:27:53 -06:00 committed by GitHub
parent eddbf137a2
commit bde767d2e7
3 changed files with 7 additions and 11 deletions

View file

@ -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)
}

View file

@ -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,

View file

@ -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)
}