Skip to content

Commit

Permalink
Merge pull request #5676 from filecoin-project/feat/list-gas-stats
Browse files Browse the repository at this point in the history
chain list --gas-stats display capacity
  • Loading branch information
magik6k authored Feb 26, 2021
2 parents 29c9fa3 + 10e1b26 commit fe69b56
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 fe69b56

Please sign in to comment.