Merge pull request #990 from filecoin-project/feat/no-unseal-bench

add a flag for bench to not run unseal
This commit is contained in:
Łukasz Magiera 2019-12-19 21:56:27 +01:00 committed by GitHub
commit 09cc1639c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,6 +89,10 @@ func main() {
Name: "json-out",
Usage: "output results in json format",
},
&cli.BoolFlag{
Name: "skip-unseal",
Usage: "skip the unseal portion of the benchmark",
},
},
Action: func(c *cli.Context) error {
if c.Bool("no-gpu") {
@ -218,18 +222,19 @@ func main() {
verifySeal := time.Now()
log.Info("Unsealing sector")
rc, err := sb.ReadPieceFromSealedSector(1, 0, dataSize, ticket.TicketBytes[:], commD[:])
if err != nil {
return err
}
if !c.Bool("skip-unseal") {
log.Info("Unsealing sector")
rc, err := sb.ReadPieceFromSealedSector(1, 0, dataSize, ticket.TicketBytes[:], commD[:])
if err != nil {
return err
}
if err := rc.Close(); err != nil {
return err
}
}
unseal := time.Now()
if err := rc.Close(); err != nil {
return err
}
sealTimings = append(sealTimings, SealingResult{
AddPiece: addpiece.Sub(start),
PreCommit: precommit.Sub(addpiece),