Skip to content

Commit

Permalink
mdbx_to_mdbx: print alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Feb 12, 2023
1 parent 320c6b2 commit 1f53952
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/integration/commands/refetence_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import (
"encoding/hex"
"fmt"
"os"
"runtime"
"strings"
"time"

common2 "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon-lib/common/dbg"
"github.com/ledgerwatch/erigon-lib/kv"
mdbx2 "github.com/ledgerwatch/erigon-lib/kv/mdbx"
"github.com/ledgerwatch/erigon/common"
Expand Down Expand Up @@ -487,7 +489,10 @@ func kv2kv(ctx context.Context, src, dst kv.RwDB) error {
case <-ctx.Done():
return ctx.Err()
case <-logEvery.C:
log.Info("Progress", "bucket", name, "progress", fmt.Sprintf("%.1fm/%.1fm", float64(i)/1_000_000, float64(total)/1_000_000), "key", hex.EncodeToString(k))
var m runtime.MemStats
dbg.ReadMemStats(&m)
log.Info("Progress", "bucket", name, "progress", fmt.Sprintf("%.1fm/%.1fm", float64(i)/1_000_000, float64(total)/1_000_000), "key", hex.EncodeToString(k),
"alloc", common2.ByteCount(m.Alloc), "sys", common2.ByteCount(m.Sys))
default:
}
}
Expand Down

0 comments on commit 1f53952

Please sign in to comment.