From 8007c1f9ae7027b42c821e95c6ab496190486ef7 Mon Sep 17 00:00:00 2001 From: zgfzgf <1901989065@qq.com> Date: Sat, 28 Nov 2020 20:03:26 +0800 Subject: [PATCH] feat bitfield stat --- cmd/lotus-shed/bitfield.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cmd/lotus-shed/bitfield.go b/cmd/lotus-shed/bitfield.go index be41d85af..c76a3f850 100644 --- a/cmd/lotus-shed/bitfield.go +++ b/cmd/lotus-shed/bitfield.go @@ -110,14 +110,8 @@ var bitFieldRunsCmd = &cli.Command{ var bitFieldStatCmd = &cli.Command{ Name: "stat", + Usage: "Bitfield stats", Description: "print bitfield stats", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "enc", - Value: "base64", - Usage: "specify input encoding to parse", - }, - }, Action: func(cctx *cli.Context) error { var val string if cctx.Args().Present() { @@ -147,6 +141,7 @@ var bitFieldStatCmd = &cli.Command{ default: return fmt.Errorf("unrecognized encoding: %s", cctx.String("enc")) } + fmt.Printf("Raw length: %d bits (%d bytes)\n", len(dec)*8, len(dec)) rle, err := rlepluslazy.FromBuf(dec) if err != nil { @@ -158,10 +153,7 @@ var bitFieldStatCmd = &cli.Command{ return xerrors.Errorf("getting run iterator: %w", err) } - fmt.Printf("Raw length: %d bits (%d bytes)\n", len(dec)*8, len(dec)) - var ones, zeros, oneRuns, zeroRuns, invalid uint64 - for rit.HasNext() { r, err := rit.NextRun() if err != nil {