jstests/libs/profiler.js
/**
 * Throws an assertion if the profiler does not contain exactly 'numExpectedMatches' entries
 * matching "filter". Optional arguments "errorMsgFilter" and "errorMsgProj" limit profiler output
 * if this asserts.
 */
Throws an assertion if the profiler does not contain exactly 'numExpectedMatches' entries
matching "filter". Optional arguments "errorMsgFilter" and "errorMsgProj" limit profiler output
if this asserts.
Throws an assertion if the profiler does not contain exactly ' numExpectedMatches ' entries matching " filter " . Optional arguments " errorMsgFilter " and " errorMsgProj " limit profiler output if this asserts .
function profilerHasNumMatchingEntriesOrThrow(
    {profileDB, filter, numExpectedMatches, errorMsgFilter, errorMsgProj}) {
    assert(typeof numExpectedMatches === 'number' && numExpectedMatches >= 0,
           "'numExpectedMatches' must be a number >= 0");
    assert.eq(profileDB.system.profile.find(filter).itcount(),
              numExpectedMatches,
              "Expected exactly " + numExpectedMatches + " op(s) matching: " + tojson(filter) +
                  " in profiler " +
                  tojson(profileDB.system.profile.find(errorMsgFilter, errorMsgProj).toArray()));
}
function profilerHasNumMatchingEntriesOrThrow ( { profileDB , filter , numExpectedMatches , errorMsgFilter , errorMsgProj } ) { assert ( typeof numExpectedMatches === 'number' && numExpectedMatches >= 0 , "'numExpectedMatches' must be a number >= 0" ) ; assert . eq ( profileDB . system . profile . find ( filter ) . itcount ( ) , numExpectedMatches , "Expected exactly " + numExpectedMatches + " op(s) matching: " + tojson ( filter ) + " in profiler " + tojson ( profileDB . system . profile . find ( errorMsgFilter , errorMsgProj ) . toArray ( ) ) ) ; }
Throws an assertion if the profiler does not contain exactly 'numExpectedMatches' entries
 matching "filter".
Throws an assertion if the profiler does not contain exactly ' numExpectedMatches ' entries matching " filter " .