jstests/noPassthrough/logs_query_hash.js
// Ensure the slow query log contains the same queryHash and planCacheKey as the explain output.
Ensure the slow query log contains the same queryHash and planCacheKey as the explain output.
Ensure the slow query log contains the same queryHash and planCacheKey as the explain output .
function runAndVerifySlowQueryLog(pipeline, commentObj, hint) {
    assert.eq(db.foo.aggregate(pipeline, commentObj, hint).itcount(), 1);
    let queryPlanner =
        db.foo.explain().aggregate(pipeline, commentObj, hint).stages[0].$cursor.queryPlanner;
    const logId = 51803;
    let expectedLog = {};
    expectedLog.command = {};
    expectedLog.command.cursor = {};
    expectedLog.command.comment = commentObj.comment;
    expectedLog.queryHash = queryPlanner.queryHash;
    expectedLog.planCacheKey = queryPlanner.planCacheKey;
    assert(checkLog.checkContainsWithCountJson(db, logId, expectedLog, 1, null, true),
           "failed to find [" + tojson(expectedLog) + "] in the slow query log");
}
function runAndVerifySlowQueryLog ( pipeline , commentObj , hint ) { assert . eq ( db . foo . aggregate ( pipeline , commentObj , hint ) . itcount ( ) , 1 ) ; let queryPlanner = db . foo . explain ( ) . aggregate ( pipeline , commentObj , hint ) . stages [ 0 ] . $cursor . queryPlanner ; const logId = 51803 ; let expectedLog = { } ; expectedLog . command = { } ; expectedLog . command . cursor = { } ; expectedLog . command . comment = commentObj . comment ; expectedLog . queryHash = queryPlanner . queryHash ; expectedLog . planCacheKey = queryPlanner . planCacheKey ; assert ( checkLog . checkContainsWithCountJson ( db , logId , expectedLog , 1 , null , true ) , "failed to find [" + tojson ( expectedLog ) + "] in the slow query log" ) ; }
Ensure the slow query log contains the same queryHash and planCacheKey as the explain output.
Ensure the slow query log contains the same queryHash and planCacheKey as the explain output .