Skip to content

Commit

Permalink
Merge pull request #4050 from filecoin-project/fix/stats-network-power
Browse files Browse the repository at this point in the history
Add back network power to stats
  • Loading branch information
magik6k authored Sep 28, 2020
2 parents bc495a5 + 1c5cb50 commit c448d85
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/stats/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"
"time"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin/reward"
Expand Down Expand Up @@ -252,6 +253,14 @@ func RecordTipsetStatePoints(ctx context.Context, api api.FullNode, pl *PointLis
p := NewPoint("network.balance", netBalFilFloat)
pl.AddPoint(p)

totalPower, err := api.StateMinerPower(ctx, address.Address{}, tipset.Key())
if err != nil {
return err
}

p = NewPoint("chain.power", totalPower.TotalPower.QualityAdjPower.Int64())
pl.AddPoint(p)

miners, err := api.StateListMiners(ctx, tipset.Key())
if err != nil {
return err
Expand Down

0 comments on commit c448d85

Please sign in to comment.