summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod
diff options
context:
space:
mode:
authorHenrik Ingo <henrik.ingo@mongodb.com>2019-12-05 14:07:37 +0000
committerevergreen <evergreen@mongodb.com>2019-12-05 14:07:37 +0000
commitd241f076b1b38bb0e38b43ddd592b3f2a51adea2 (patch)
tree738ec4de53f7d400188bf514dc16a6fff2996ef6 /jstests/noPassthroughWithMongod
parent95eedd93ea7a5b8b35b9bb042d5ca165736c17c2 (diff)
downloadmongo-d241f076b1b38bb0e38b43ddd592b3f2a51adea2.tar.gz
SERVER-42697 Add setParameter tcmallocReleaseRate
Diffstat (limited to 'jstests/noPassthroughWithMongod')
-rw-r--r--jstests/noPassthroughWithMongod/tcmalloc.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/tcmalloc.js b/jstests/noPassthroughWithMongod/tcmalloc.js
new file mode 100644
index 00000000000..e69850fc8e0
--- /dev/null
+++ b/jstests/noPassthroughWithMongod/tcmalloc.js
@@ -0,0 +1,23 @@
+// Assert setting tcmalloc_release_rate with setParameter.
+
+(function() {
+"use strict";
+
+// Check that setParameter is available on this build. And whether tcmallocReleaseRate is.
+function hasTcSetParameter() {
+ const commandResult = db.adminCommand({getParameter: 1, tcmallocReleaseRate: 1});
+ if (commandResult.ok)
+ return true;
+ else
+ return false;
+}
+
+if (hasTcSetParameter()) {
+ assert.commandWorked(db.adminCommand({setParameter: 1, tcmallocReleaseRate: 10}));
+ assert.commandWorked(db.adminCommand({setParameter: 1, tcmallocReleaseRate: 5.0}));
+ assert.commandWorked(db.adminCommand({setParameter: 1, tcmallocReleaseRate: 0.01}));
+ assert.commandWorked(db.adminCommand({setParameter: 1, tcmallocReleaseRate: 0}));
+ assert.commandFailed(db.adminCommand({setParameter: 1, tcmallocReleaseRate: -1.0}));
+ assert.commandFailed(db.adminCommand({setParameter: 1, tcmallocReleaseRate: "foo"}));
+}
+}()); \ No newline at end of file