From da4bc44032dd5cd91db2d8b44c228d2562a1fb47 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 28 Jul 2020 21:00:19 +0200 Subject: [PATCH] Discard initial very long OnVerifyPost from analisys Signed-off-by: Jakub Sztandera --- cmd/lotus-bench/import.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cmd/lotus-bench/import.go b/cmd/lotus-bench/import.go index 9ea3e8d0f..edaf994c2 100644 --- a/cmd/lotus-bench/import.go +++ b/cmd/lotus-bench/import.go @@ -409,6 +409,12 @@ func tallyGasCharges(charges map[string]*stats, et types.ExecutionTrace) { continue } tt := float64(gc.TimeTaken.Nanoseconds()) + if name == "OnVerifyPost" && tt > 2e9 { + // discard initial very long OnVerifyPost + continue + } + eType, eSize := getExtras(gc.Extra) + if name == "OnIpldGet" { next := &types.GasTrace{} if i+1 < len(et.GasCharges) { @@ -416,14 +422,18 @@ func tallyGasCharges(charges map[string]*stats, et types.ExecutionTrace) { } if next.Name != "OnIpldGetEnd" { log.Warn("OnIpldGet without OnIpldGetEnd") + } else { + _, size := getExtras(next.Extra) + eSize = size } - tt += float64(next.TimeTaken.Nanoseconds()) } - eType, eSize := getExtras(gc.Extra) if eType != nil { name += "-" + *eType } - compGas := gc.VirtualComputeGas + compGas := gc.ComputeGas + if compGas == 0 { + compGas = gc.VirtualComputeGas + } if compGas == 0 { compGas = 1 }