From 6f7fa29d9bef1d6503125041d2db0a39ffbcbbe3 Mon Sep 17 00:00:00 2001 From: Ivan Martinez Date: Thu, 23 Apr 2020 21:57:10 -0400 Subject: [PATCH] Actually fix percentages --- validator/client/validator_metrics.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/validator/client/validator_metrics.go b/validator/client/validator_metrics.go index cab6a4b0112a..463276605d35 100644 --- a/validator/client/validator_metrics.go +++ b/validator/client/validator_metrics.go @@ -118,10 +118,10 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot uint64) log.WithFields(logrus.Fields{ "epoch": (slot / params.BeaconConfig().SlotsPerEpoch) - 1, - "attestationInclusionPercentage": fmt.Sprintf("%.2f", float64(included)/float64(len(resp.InclusionSlots)*100)), - "correctlyVotedSourcePercentage": fmt.Sprintf("%.2f", float64(votedSource)/float64(len(resp.CorrectlyVotedSource)*100)), - "correctlyVotedTargetPercentage": fmt.Sprintf("%.2f", float64(votedTarget)/float64(len(resp.CorrectlyVotedTarget)*100)), - "correctlyVotedHeadPercentage": fmt.Sprintf("%.2f", float64(votedHead)/float64(len(resp.CorrectlyVotedHead)*100)), + "attestationInclusionPercentage": fmt.Sprintf("%.0f%%", (float64(included)/float64(len(resp.InclusionSlots)))*100), + "correctlyVotedSourcePercentage": fmt.Sprintf("%.0f%%", (float64(votedSource)/float64(len(resp.CorrectlyVotedSource)))*100), + "correctlyVotedTargetPercentage": fmt.Sprintf("%.0f%%", (float64(votedTarget)/float64(len(resp.CorrectlyVotedTarget)))*100), + "correctlyVotedHeadPercentage": fmt.Sprintf("%.0f%%", (float64(votedHead)/float64(len(resp.CorrectlyVotedHead)))*100), }).Info("Previous epoch aggregated voting summary") return nil