From c0eaabb18e6a5d363f2c1e4f2b0d14f996ddb778 Mon Sep 17 00:00:00 2001 From: Peter Nose Date: Fri, 27 Oct 2023 21:54:31 +0200 Subject: [PATCH] fix(cmd/paratime): Fix proposer stats --- cmd/paratime/statistics.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/paratime/statistics.go b/cmd/paratime/statistics.go index 1c22d138..c89e0d50 100644 --- a/cmd/paratime/statistics.go +++ b/cmd/paratime/statistics.go @@ -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: } } }