jstests/sharding/hedging_metrics_server_status.js
/*
 * Verifies that the server status response has the hegingMetrics fields that we expect.
 */
Verifies that the server status response has the hegingMetrics fields that we expect.
Verifies that the server status response has the hegingMetrics fields that we expect .
function verifyServerStatusFields(serverStatusResponse) {
    assert(serverStatusResponse.hasOwnProperty("hedgingMetrics"),
           "Expected the serverStatus response to have a 'hedgingMetrics' field\n" +
               tojson(serverStatusResponse));
    assert(
        serverStatusResponse.hedgingMetrics.hasOwnProperty("numTotalOperations"),
        "The 'hedgingMetrics' field in serverStatus did not have the 'numTotalOperations' field\n" +
            tojson(serverStatusResponse.hedgingMetrics));
    assert(
        serverStatusResponse.hedgingMetrics.hasOwnProperty("numTotalHedgedOperations"),
        "The 'hedgingMetrics' field in serverStatus did not have the 'numTotalHedgedOperations' field\n" +
            tojson(serverStatusResponse.hedgingMetrics));
    assert(
        serverStatusResponse.hedgingMetrics.hasOwnProperty("numAdvantageouslyHedgedOperations"),
        "The 'hedgingMetrics' field in serverStatus did not have the 'numAdvantageouslyHedgedOperations' field\n" +
            tojson(serverStatusResponse.hedgingMetrics));
}
function verifyServerStatusFields ( serverStatusResponse ) { assert ( serverStatusResponse . hasOwnProperty ( "hedgingMetrics" ) , "Expected the serverStatus response to have a 'hedgingMetrics' field\n" + tojson ( serverStatusResponse ) ) ; assert ( serverStatusResponse . hedgingMetrics . hasOwnProperty ( "numTotalOperations" ) , "The 'hedgingMetrics' field in serverStatus did not have the 'numTotalOperations' field\n" + tojson ( serverStatusResponse . hedgingMetrics ) ) ; assert ( serverStatusResponse . hedgingMetrics . hasOwnProperty ( "numTotalHedgedOperations" ) , "The 'hedgingMetrics' field in serverStatus did not have the 'numTotalHedgedOperations' field\n" + tojson ( serverStatusResponse . hedgingMetrics ) ) ; assert ( serverStatusResponse . hedgingMetrics . hasOwnProperty ( "numAdvantageouslyHedgedOperations" ) , "The 'hedgingMetrics' field in serverStatus did not have the 'numAdvantageouslyHedgedOperations' field\n" + tojson ( serverStatusResponse . hedgingMetrics ) ) ; }
Verifies that the server status response has the hegingMetrics fields that we expect.
Verifies that the server status response has the hegingMetrics fields that we expect .