Skip to content

Commit

Permalink
chain list --gas-stats display capacity
Browse files Browse the repository at this point in the history
Add tipset capacity display to `chain list`

Signed-off-by: Jakub Sztandera <[email protected]>
  • Loading branch information
Jakub Sztandera committed Feb 24, 2021
1 parent 3c9e376 commit b8224d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,10 @@ var chainListCmd = &cli.Command{
gasUsed += r.GasUsed
}

fmt.Printf("\ttipset: \t%d msgs, %d / %d (%0.2f%%)\n", len(msgs), gasUsed, limitSum, 100*float64(gasUsed)/float64(limitSum))
gasEfficiency := 100*float64(gasUsed)/float64(limitSum)
gasCapacity := 100*float64(limitSum)/float64(build.BlockGasLimit

fmt.Printf("\ttipset: \t%d msgs, %d (%0.2f%%) / %d (%0.2f%%)\n", len(msgs), gasUsed, gasEfficiency, limitSum, gasCapacity)
}
fmt.Println()
}
Expand Down

0 comments on commit b8224d7

Please sign in to comment.