jstests/replsets/server_election_metrics.js
// Verifies that the 'electionMetrics' serverStatus section has the given field.
Verifies that the 'electionMetrics' serverStatus section has the given field.
Verifies that the ' electionMetrics ' serverStatus section has the given field .
function verifyElectionMetricsField(serverStatusResponse, fieldName) {
    assert(serverStatusResponse.electionMetrics.hasOwnProperty(fieldName),
           () => (`The 'electionMetrics' serverStatus section did not have the '${fieldName}' \
field: \n${tojson(serverStatusResponse.electionMetrics)}`));
    return serverStatusResponse.electionMetrics[fieldName];
}
function verifyElectionMetricsField ( serverStatusResponse , fieldName ) { assert ( serverStatusResponse . electionMetrics . hasOwnProperty ( fieldName ) , ( ) => ( ` ${ fieldName } \
 \n ${ tojson ( serverStatusResponse . electionMetrics ) } ` ) ) ; return serverStatusResponse . electionMetrics [ fieldName ] ; }
Verifies that the 'electionMetrics' serverStatus section has the given field.
Verifies that the ' electionMetrics ' serverStatus section has the given field .