jstests/sharding/resharding_metrics.js
// Tests the currentOp output for each donor, each recipient, and the coordinator.
Tests the currentOp output for each donor, each recipient, and the coordinator.
Tests the currentOp output for each donor each recipient and the coordinator .
function checkCurrentOp(mongo, clusterName, role, expected) {
    function getCurrentOpReport(mongo, role) {
        return mongo.getDB("admin").currentOp(
            {ns: kNamespace, desc: {$regex: 'Resharding' + role + 'Service.*'}});
    }
    jsTest.log(`Testing currentOp output for ${role}s on ${clusterName}`);
    assert.soon(() => {
        const report = getCurrentOpReport(mongo, role);
        if (report.inprog.length === 1)
            return true;
        jsTest.log(tojson(report));
        return false;
    }, () => `: was unable to find resharding ${role} service in currentOp output`);
    verifyMetrics(getCurrentOpReport(mongo, role).inprog[0], expected);
}
function checkCurrentOp ( mongo , clusterName , role , expected ) { function getCurrentOpReport ( mongo , role ) { return mongo . getDB ( "admin" ) . currentOp ( { ns : kNamespace , desc : { $regex : 'Resharding' + role + 'Service.*' } } ) ; } jsTest . log ( ` ${ role } ${ clusterName } ` ) ; assert . soon ( ( ) => { const report = getCurrentOpReport ( mongo , role ) ; if ( report . inprog . length === 1 ) return true ; jsTest . log ( tojson ( report ) ) ; return false ; } , ( ) => ` ${ role } ` ) ; verifyMetrics ( getCurrentOpReport ( mongo , role ) . inprog [ 0 ] , expected ) ; }
Tests the currentOp output for each donor, each recipient, and the coordinator.
Tests the currentOp output for each donor each recipient and the coordinator .