From 91f53904cb2cd7f2bea9b297ca0849d508847b48 Mon Sep 17 00:00:00 2001 From: Richard Liu Date: Thu, 30 Aug 2018 21:34:20 -0700 Subject: [PATCH] report nodeCount. --- consensus/consensus_leader.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/consensus/consensus_leader.go b/consensus/consensus_leader.go index af9b0c97e..3179b4421 100644 --- a/consensus/consensus_leader.go +++ b/consensus/consensus_leader.go @@ -414,14 +414,15 @@ func (consensus *Consensus) reportTPS(numOfTxs int32) { "timeElapsed", timeElapsed, "TPS", tps, "consensus", consensus) - reportMetrics(numOfTxs, tps) + consensus.reportMetrics(numOfTxs, tps) } -func reportMetrics(numOfTxs int32, tps float64) { +func (consensus *Consensus) reportMetrics(numOfTxs int32, tps float64) { URL := "http://localhost:3000/report" form := url.Values{ - "tps": {strconv.FormatFloat(tps, 'f', 2, 64)}, - "txCount": {strconv.Itoa(int(numOfTxs))}, + "tps": {strconv.FormatFloat(tps, 'f', 2, 64)}, + "txCount": {strconv.Itoa(int(numOfTxs))}, + "nodeCount": {strconv.Itoa(len(consensus.validators) + 1)}, } body := bytes.NewBufferString(form.Encode())