mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
finish add write elapsed
Signed-off-by: Delweng <delweng@gmail.com>
This commit is contained in:
parent
2b64c5c938
commit
26a17bc410
1 changed files with 7 additions and 1 deletions
|
|
@ -208,6 +208,8 @@ func (b *batchIndexer) finish(force bool) error {
|
||||||
if err := eg.Wait(); err != nil {
|
if err := eg.Wait(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
mtime := time.Now()
|
||||||
|
|
||||||
// Update the position of last indexed state history
|
// Update the position of last indexed state history
|
||||||
if !b.delete {
|
if !b.delete {
|
||||||
storeIndexMetadata(batch, b.lastID)
|
storeIndexMetadata(batch, b.lastID)
|
||||||
|
|
@ -218,10 +220,14 @@ func (b *batchIndexer) finish(force bool) error {
|
||||||
storeIndexMetadata(batch, b.lastID-1)
|
storeIndexMetadata(batch, b.lastID-1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
wtime := time.Now()
|
||||||
if err := batch.Write(); err != nil {
|
if err := batch.Write(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Debug("Committed batch indexer", "accounts", len(b.accounts), "storages", storages, "records", b.counter, "elapsed", common.PrettyDuration(time.Since(start)))
|
log.Debug("Committed batch indexer", "accounts", len(b.accounts), "storages", storages, "records", b.counter, "elapsed", common.PrettyDuration(time.Since(start)),
|
||||||
|
"mtime", common.PrettyDuration(mtime.Sub(start)),
|
||||||
|
"utime", common.PrettyDuration(wtime.Sub(mtime)),
|
||||||
|
"wtime", common.PrettyDuration(time.Since(wtime)))
|
||||||
b.counter = 0
|
b.counter = 0
|
||||||
b.accounts = make(map[common.Hash][]uint64)
|
b.accounts = make(map[common.Hash][]uint64)
|
||||||
b.storages = make(map[common.Hash]map[common.Hash][]uint64)
|
b.storages = make(map[common.Hash]map[common.Hash][]uint64)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue