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 <kubuxu@protocol.ai>
  • Loading branch information
Jakub Sztandera committed Feb 26, 2021
1 parent c9c26ee commit 10e1b26
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 10e1b26

Please sign in to comment.