cmd/geth, ethdb/pebble: polish method naming and code comment

This commit is contained in:
prpeh 2024-06-06 23:20:52 +07:00
parent 85459e1439
commit 9c3cc83a03
3 changed files with 7 additions and 7 deletions

View file

@ -337,7 +337,7 @@ func importChain(ctx *cli.Context) error {
fmt.Printf("Import done in %v.\n\n", time.Since(start))
// Output pre-compaction stats mostly to see the import trashing
showLeveldbStats(db)
showDBStats(db)
// Print the memory statistics used by the importing
mem := new(runtime.MemStats)
@ -360,7 +360,7 @@ func importChain(ctx *cli.Context) error {
}
fmt.Printf("Compaction done in %v.\n\n", time.Since(start))
showLeveldbStats(db)
showDBStats(db)
return importErr
}

View file

@ -407,7 +407,7 @@ func checkStateContent(ctx *cli.Context) error {
return nil
}
func showLeveldbStats(db ethdb.KeyValueStater) {
func showDBStats(db ethdb.KeyValueStater) {
if stats, err := db.Stat("leveldb.stats"); err != nil {
log.Warn("Failed to read database stats", "error", err)
} else {
@ -427,7 +427,7 @@ func dbStats(ctx *cli.Context) error {
db := utils.MakeChainDatabase(ctx, stack, true)
defer db.Close()
showLeveldbStats(db)
showDBStats(db)
return nil
}
@ -439,7 +439,7 @@ func dbCompact(ctx *cli.Context) error {
defer db.Close()
log.Info("Stats before compaction")
showLeveldbStats(db)
showDBStats(db)
log.Info("Triggering compaction")
if err := db.Compact(nil, nil); err != nil {
@ -447,7 +447,7 @@ func dbCompact(ctx *cli.Context) error {
return err
}
log.Info("Stats after compaction")
showLeveldbStats(db)
showDBStats(db)
return nil
}

View file

@ -416,7 +416,7 @@ func upperBound(prefix []byte) (limit []byte) {
}
// 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.
// 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.
func (d *Database) Stat(property string) (string, error) {