diff options
author | Xuerui Fa <xuerui.fa@mongodb.com> | 2019-09-24 22:05:25 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-24 22:05:25 +0000 |
commit | 87c9601a762048ea93559b13c3b6043b4017b024 (patch) | |
tree | 53bcfc92de03569acff232f5a66f8a9f56f07fa1 /src/mongo/db/repl/replication_metrics.h | |
parent | 249e950a56c0ed9dd2ba9eb24cb4691a1b1b79ab (diff) | |
download | mongo-87c9601a762048ea93559b13c3b6043b4017b024.tar.gz |
SERVER-41506 Added tracking for metrics around a nodes calling an election
Diffstat (limited to 'src/mongo/db/repl/replication_metrics.h')
-rw-r--r-- | src/mongo/db/repl/replication_metrics.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mongo/db/repl/replication_metrics.h b/src/mongo/db/repl/replication_metrics.h index a07f84e48cf..14e31f59eba 100644 --- a/src/mongo/db/repl/replication_metrics.h +++ b/src/mongo/db/repl/replication_metrics.h @@ -49,8 +49,8 @@ public: ~ReplicationMetrics(); // Election metrics - void incrementNumElectionsCalledForReason(TopologyCoordinator::StartElectionReason reason); - void incrementNumElectionsSuccessfulForReason(TopologyCoordinator::StartElectionReason reason); + void incrementNumElectionsCalledForReason(StartElectionReasonEnum reason); + void incrementNumElectionsSuccessfulForReason(StartElectionReasonEnum reason); void incrementNumStepDownsCausedByHigherTerm(); void incrementNumCatchUps(); void incrementNumCatchUpsConcludedForReason( @@ -81,7 +81,15 @@ public: // All the election candidate metrics that should be set when a node calls an election are set // in this one function, so that the 'electionCandidateMetrics' section of replSetStatus shows a // consistent state. - void setElectionCandidateMetrics(Date_t lastElectionDate); + void setElectionCandidateMetrics(const StartElectionReasonEnum reason, + const Date_t lastElectionDate, + const long long termAtElection, + const OpTime lastCommittedOpTime, + const OpTime lastSeenOpTime, + const int numVotesNeeded, + const double priorityAtElection, + const Milliseconds electionTimeoutMillis, + const boost::optional<int> priorPrimary); void setTargetCatchupOpTime(OpTime opTime); void setNumCatchUpOps(int numCatchUpOps); void setNewTermStartDate(Date_t newTermStartDate); |