Skip to content

Commit

Permalink
Merge pull request #149 from oasisprotocol/peternose/bugfix/fix-propo…
Browse files Browse the repository at this point in the history
…ser-stats

fix(cmd/paratime): Fix proposer stats
  • Loading branch information
peternose authored Oct 28, 2023
2 parents f118362 + c0eaabb commit ae3e43d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cmd/paratime/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,15 @@ var statsCmd = &cobra.Command{
}
seen[member.PublicKey] = true

if member.Role == scheduler.RoleWorker {
switch member.Role {
case scheduler.RoleWorker:
stats.entities[entity].roundsPrimary++
}
if member.Role == scheduler.RoleBackupWorker {
if member.PublicKey == currentScheduler.PublicKey {
stats.entities[entity].roundsProposer++
}
case scheduler.RoleBackupWorker:
stats.entities[entity].roundsBackup++
}
if member.PublicKey == currentScheduler.PublicKey {
stats.entities[entity].roundsProposer++
case scheduler.RoleInvalid:
}
}
}
Expand Down

0 comments on commit ae3e43d

Please sign in to comment.