jstests/noPassthrough/server_read_concern_metrics.js
// Verifies that the server status response has the fields that we expect.
Verifies that the server status response has the fields that we expect.
Verifies that the server status response has the fields that we expect .
function verifyServerStatusFields(serverStatusResponse) {
    assert(serverStatusResponse.hasOwnProperty("readConcernCounters"),
           "Missing 'readConcernCounters' from serverStatus\n" + tojson(serverStatusResponse));
    assert(serverStatusResponse.readConcernCounters.hasOwnProperty("nonTransactionOps"),
           "Missing 'nonTransactionOps' from 'readConcernCounters'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.nonTransactionOps.hasOwnProperty("none"),
           "Missing 'none' from 'readConcernCounters.nonTransactionOps'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.nonTransactionOps.hasOwnProperty("local"),
           "Missing 'local' from 'readConcernCounters.nonTransactionOps'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.nonTransactionOps.hasOwnProperty("available"),
           "Missing 'available' from 'readConcernCounters.nonTransactionOps'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.nonTransactionOps.hasOwnProperty("majority"),
           "Missing 'majority' from 'readConcernCounters.nonTransactionOps'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.nonTransactionOps.hasOwnProperty("snapshot"),
           "Missing 'snapshot' from 'readConcernCounters.nonTransactionOps'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.nonTransactionOps.snapshot.hasOwnProperty(
               "withClusterTime"),
           "Missing 'withClusterTime' from 'readConcernCounters.nonTransactionOps.snapshot'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.nonTransactionOps.snapshot.hasOwnProperty(
               "withoutClusterTime"),
           "Missing 'withoutClusterTime' from 'readConcernCounters.nonTransactionOps.snapshot'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(
        serverStatusResponse.readConcernCounters.nonTransactionOps.hasOwnProperty("linearizable"),
        "Missing 'linearizable' from 'readConcernCounters.nonTransactionOps'\n" +
            tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.hasOwnProperty("transactionOps"),
           "Missing 'transactionOps' from 'readConcernCounters'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.transactionOps.hasOwnProperty("none"),
           "Missing 'none' from 'readConcernCounters.transactionOps'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.transactionOps.hasOwnProperty("local"),
           "Missing 'local' from 'readConcernCounters.transactionOps'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.transactionOps.hasOwnProperty("majority"),
           "Missing 'majority' from 'readConcernCounters.transactionOps'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.transactionOps.hasOwnProperty("snapshot"),
           "Missing 'snapshot' from 'readConcernCounters.transactionOps'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.transactionOps.snapshot.hasOwnProperty(
               "withClusterTime"),
           "Missing 'withClusterTime' from 'readConcernCounters.transactionOps.snapshot'\n" +
               tojson(serverStatusResponse.readConcernCounters));
    assert(serverStatusResponse.readConcernCounters.transactionOps.snapshot.hasOwnProperty(
               "withoutClusterTime"),
           "Missing 'withoutClusterTime' from 'readConcernCounters.transactionOps.snapshot'\n" +
               tojson(serverStatusResponse.readConcernCounters));
}
function verifyServerStatusFields ( serverStatusResponse ) { assert ( serverStatusResponse . hasOwnProperty ( "readConcernCounters" ) , "Missing 'readConcernCounters' from serverStatus\n" + tojson ( serverStatusResponse ) ) ; assert ( serverStatusResponse . readConcernCounters . hasOwnProperty ( "nonTransactionOps" ) , "Missing 'nonTransactionOps' from 'readConcernCounters'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . nonTransactionOps . hasOwnProperty ( "none" ) , "Missing 'none' from 'readConcernCounters.nonTransactionOps'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . nonTransactionOps . hasOwnProperty ( "local" ) , "Missing 'local' from 'readConcernCounters.nonTransactionOps'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . nonTransactionOps . hasOwnProperty ( "available" ) , "Missing 'available' from 'readConcernCounters.nonTransactionOps'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . nonTransactionOps . hasOwnProperty ( "majority" ) , "Missing 'majority' from 'readConcernCounters.nonTransactionOps'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . nonTransactionOps . hasOwnProperty ( "snapshot" ) , "Missing 'snapshot' from 'readConcernCounters.nonTransactionOps'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . nonTransactionOps . snapshot . hasOwnProperty ( "withClusterTime" ) , "Missing 'withClusterTime' from 'readConcernCounters.nonTransactionOps.snapshot'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . nonTransactionOps . snapshot . hasOwnProperty ( "withoutClusterTime" ) , "Missing 'withoutClusterTime' from 'readConcernCounters.nonTransactionOps.snapshot'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . nonTransactionOps . hasOwnProperty ( "linearizable" ) , "Missing 'linearizable' from 'readConcernCounters.nonTransactionOps'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . hasOwnProperty ( "transactionOps" ) , "Missing 'transactionOps' from 'readConcernCounters'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . transactionOps . hasOwnProperty ( "none" ) , "Missing 'none' from 'readConcernCounters.transactionOps'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . transactionOps . hasOwnProperty ( "local" ) , "Missing 'local' from 'readConcernCounters.transactionOps'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . transactionOps . hasOwnProperty ( "majority" ) , "Missing 'majority' from 'readConcernCounters.transactionOps'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . transactionOps . hasOwnProperty ( "snapshot" ) , "Missing 'snapshot' from 'readConcernCounters.transactionOps'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . transactionOps . snapshot . hasOwnProperty ( "withClusterTime" ) , "Missing 'withClusterTime' from 'readConcernCounters.transactionOps.snapshot'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; assert ( serverStatusResponse . readConcernCounters . transactionOps . snapshot . hasOwnProperty ( "withoutClusterTime" ) , "Missing 'withoutClusterTime' from 'readConcernCounters.transactionOps.snapshot'\n" + tojson ( serverStatusResponse . readConcernCounters ) ) ; }
Verifies that the server status response has the fields that we expect.
Verifies that the server status response has the fields that we expect .