Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add curio stats #1969

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions cmd/boostx/stats_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,15 @@ var statsCmd = &cli.Command{

fmt.Println("Total SPs with minimum power: ", len(withMinPower))

var boostNodes, marketsNodes, venusNodes, noProtocolsNodes, indexerNodes int
var boostNodes, marketsNodes, venusNodes, noProtocolsNodes, indexerNodes, curioNodes int
boostRawBytePower := big.NewInt(0)
boostQualityAdjPower := big.NewInt(0)
venusRawBytePower := big.NewInt(0)
venusQualityAdjPower := big.NewInt(0)
agentVersions := make(map[string]int)
transportProtos := make(map[string]int)
curioRawBytePower := big.NewInt(0)
curioQualityAdjPower := big.NewInt(0)

throttle = make(chan struct{}, cctx.Int("sp-query-concurrency"))
for i, maddr := range withMinPower {
Expand Down Expand Up @@ -171,7 +173,11 @@ var statsCmd = &cli.Command{
lk.Lock()
var out string
out += "Provider " + maddr.String()
if strings.Contains(agentVersion, "venus") || strings.Contains(agentVersion, "droplet") {
if strings.Contains(agentVersion, "curio") {
curioNodes++
curioQualityAdjPower = big.Add(curioQualityAdjPower, minerToMinerPower[maddr].QualityAdjPower)
curioRawBytePower = big.Add(curioRawBytePower, minerToMinerPower[maddr].RawBytePower)
} else if strings.Contains(agentVersion, "venus") || strings.Contains(agentVersion, "droplet") {
out += " is running venus"

venusNodes++
Expand Down Expand Up @@ -232,6 +238,9 @@ var statsCmd = &cli.Command{
fmt.Println("Total Boost nodes:", boostNodes)
fmt.Println("Total Boost raw power:", boostRawBytePower)
fmt.Println("Total Boost quality adj power:", boostQualityAdjPower)
fmt.Println("Total Curio nodes:", curioNodes)
fmt.Println("Total Curio raw power:", curioRawBytePower)
fmt.Println("Total Curio quality adj power:", curioQualityAdjPower)
fmt.Println("Total Venus nodes:", venusNodes)
fmt.Println("Total Venus raw power:", venusRawBytePower)
fmt.Println("Total Venus quality adj power:", venusQualityAdjPower)
Expand Down