mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-26 05:27:19 +00:00
dont re-read whole db to calculate file size (#658)
This commit is contained in:
parent
99b9c0fa99
commit
b78a6336d2
@ -203,11 +203,7 @@ func (db *LmdbKV) Close() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (db *LmdbKV) DiskSize(_ context.Context) (common.StorageSize, error) {
|
func (db *LmdbKV) DiskSize(_ context.Context) (common.StorageSize, error) {
|
||||||
stats, err := db.env.Stat()
|
return common.StorageSize(0), nil
|
||||||
if err != nil {
|
|
||||||
return 0, fmt.Errorf("could not read database size: %w", err)
|
|
||||||
}
|
|
||||||
return common.StorageSize(uint64(stats.PSize) * (stats.LeafPages + stats.BranchPages + stats.OverflowPages)), nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *LmdbKV) BucketsStat(_ context.Context) (map[string]common.StorageBucketWriteStats, error) {
|
func (db *LmdbKV) BucketsStat(_ context.Context) (map[string]common.StorageBucketWriteStats, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user