From 10e1b26580d8fc93293bd334c42d697924854df6 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 24 Feb 2021 17:09:22 +0100 Subject: [PATCH] chain list --gas-stats display capacity Add tipset capacity display to `chain list` Signed-off-by: Jakub Sztandera --- cli/chain.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/chain.go b/cli/chain.go index 539ad1a7968..e86cac9b339 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -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() }