2020-04-20 10:35:33 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
2021-05-20 18:25:53 +00:00
|
|
|
"github.com/ledgerwatch/erigon/cmd/state/stats"
|
2020-04-20 10:35:33 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2022-02-22 17:39:48 +00:00
|
|
|
withDataDir(indexStatsCmd)
|
2020-04-20 10:35:33 +00:00
|
|
|
withStatsfile(indexStatsCmd)
|
|
|
|
withIndexBucket(indexStatsCmd)
|
|
|
|
rootCmd.AddCommand(indexStatsCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
var indexStatsCmd = &cobra.Command{
|
|
|
|
Use: "indexStats",
|
|
|
|
Short: "Stats about index chunks",
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
if statsfile == "stateless.csv" {
|
|
|
|
statsfile = ""
|
|
|
|
}
|
2020-08-10 23:55:32 +00:00
|
|
|
return stats.IndexStats(chaindata, indexBucket, statsfile)
|
2020-04-20 10:35:33 +00:00
|
|
|
},
|
|
|
|
}
|