summaryrefslogtreecommitdiff
path: root/jstests/libs/profiler.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/libs/profiler.js')
-rw-r--r--jstests/libs/profiler.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/jstests/libs/profiler.js b/jstests/libs/profiler.js
index 593836b127c..e8282fecba6 100644
--- a/jstests/libs/profiler.js
+++ b/jstests/libs/profiler.js
@@ -42,3 +42,12 @@ function profilerHasMatchingEntryOrThrow(inputDb, filter, errorMsgFilter, errorM
"Expected at least one op matching: " + tojson(filter) + " in profiler " +
tojson(inputDb.system.profile.find(errorMsgFilter, errorMsgProj).toArray()));
}
+
+// Throws an assertion if the profiler contains an entry matching <filter>.
+// Optional arguments <errorMsgFilter> and <errorMsgProj> limit profiler output if this asserts.
+function profilerDoesNotHaveMatchingEntryOrThrow(inputDb, filter, errorMsgFilter, errorMsgProj) {
+ assert.eq(inputDb.system.profile.find(filter).itcount(),
+ 0,
+ "Expected no ops matching: " + tojson(filter) + " in profiler " +
+ tojson(inputDb.system.profile.find(errorMsgFilter, errorMsgProj).toArray()));
+}