jstests/replsets/libs/election_metrics.js
/**
 * Verifies that the given election reason counter has the value we expect in the
 * 'electionMetrics' serverStatus section.
 */
Verifies that the given election reason counter has the value we expect in the
'electionMetrics' serverStatus section.
Verifies that the given election reason counter has the value we expect in the ' electionMetrics ' serverStatus section .
function verifyServerStatusElectionReasonCounterValue(electionMetrics, fieldName, value) {
    const field = electionMetrics[fieldName];
    assert.eq(
        field["called"], value, `expected the 'called' field of '${fieldName}' to be ${value}`);
    assert.eq(field["successful"],
              value,
              `expected the 'successful' field of '${fieldName}' to be ${value}`);
}
function verifyServerStatusElectionReasonCounterValue ( electionMetrics , fieldName , value ) { const field = electionMetrics [ fieldName ] ; assert . eq ( field [ "called" ] , value , ` ${ fieldName } ${ value } ` ) ; assert . eq ( field [ "successful" ] , value , ` ${ fieldName } ${ value } ` ) ; }
Verifies that the given election reason counter has the value we expect in the
 'electionMetrics' serverStatus section.
Verifies that the given election reason counter has the value we expect in the ' electionMetrics ' serverStatus section .