Merge pull request #3995 from filecoin-project/feat/more-stateroot-stats
add some more big pictures stats to stateroot stat
This commit is contained in:
commit
45d8cb08ba
@ -182,6 +182,11 @@ var staterootStatCmd = &cli.Command{
|
|||||||
return infos[i].Stat.Size > infos[j].Stat.Size
|
return infos[i].Stat.Size > infos[j].Stat.Size
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var totalActorsSize uint64
|
||||||
|
for _, info := range infos {
|
||||||
|
totalActorsSize += info.Stat.Size
|
||||||
|
}
|
||||||
|
|
||||||
outcap := 10
|
outcap := 10
|
||||||
if cctx.Args().Len() > outcap {
|
if cctx.Args().Len() > outcap {
|
||||||
outcap = cctx.Args().Len()
|
outcap = cctx.Args().Len()
|
||||||
@ -190,6 +195,15 @@ var staterootStatCmd = &cli.Command{
|
|||||||
outcap = len(infos)
|
outcap = len(infos)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
totalStat, err := api.ChainStatObj(ctx, ts.ParentState(), cid.Undef)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("Total state tree size: ", totalStat.Size)
|
||||||
|
fmt.Println("Sum of actor state size: ", totalActorsSize)
|
||||||
|
fmt.Println("State tree structure size: ", totalStat.Size-totalActorsSize)
|
||||||
|
|
||||||
fmt.Print("Addr\tType\tSize\n")
|
fmt.Print("Addr\tType\tSize\n")
|
||||||
for _, inf := range infos[:outcap] {
|
for _, inf := range infos[:outcap] {
|
||||||
cmh, err := multihash.Decode(inf.Actor.Code.Hash())
|
cmh, err := multihash.Decode(inf.Actor.Code.Hash())
|
||||||
|
Loading…
Reference in New Issue
Block a user