feat(lotus-sim): record timing information for pre/prove-commit packing

This commit is contained in:
Steven Allen 2021-06-09 19:35:22 -07:00
parent 868231adc7
commit 1802ae31a6
2 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package simulation
import (
"context"
"fmt"
"time"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
@ -35,6 +36,7 @@ func (ss *simulationState) packPreCommits(ctx context.Context, cb packFunc) (_er
full bool
top1Count, top10Count, restCount int
)
start := time.Now()
defer func() {
if _err != nil {
return
@ -45,6 +47,7 @@ func (ss *simulationState) packPreCommits(ctx context.Context, cb packFunc) (_er
"top10", top10Count,
"rest", restCount,
"filled-block", full,
"duration", time.Since(start),
)
}()

View File

@ -2,6 +2,7 @@ package simulation
import (
"context"
"time"
"github.com/filecoin-project/go-bitfield"
@ -25,6 +26,7 @@ func (ss *simulationState) packProveCommits(ctx context.Context, cb packFunc) (_
// Roll the commitQueue forward.
ss.commitQueue.advanceEpoch(ss.nextEpoch())
start := time.Now()
var full, failed, done, unbatched, count int
defer func() {
if _err != nil {
@ -38,6 +40,7 @@ func (ss *simulationState) packProveCommits(ctx context.Context, cb packFunc) (_
"unbatched", unbatched,
"miners-processed", count,
"filled-block", full,
"duration", time.Since(start),
)
}()