diff options
author | Aaron <aaron@10gen.com> | 2012-02-07 11:39:58 -0800 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2012-02-07 11:39:58 -0800 |
commit | f0e4452fdf583c321770d721c726d5d78e832ea5 (patch) | |
tree | 8847cd2fabddc32f3078cc2a2f715c676a8740b2 /jstests/getlog2.js | |
parent | a4173c1e6ab92b3f0bf6e4e87ce67cb9faedfa86 (diff) | |
download | mongo-f0e4452fdf583c321770d721c726d5d78e832ea5.tar.gz |
Revert "SERVER-4729: Ensure query logged when slow"
This reverts commit a950ba5fc7e48a92120ac94dff16c0d2de657285.
Diffstat (limited to 'jstests/getlog2.js')
-rw-r--r-- | jstests/getlog2.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/jstests/getlog2.js b/jstests/getlog2.js deleted file mode 100644 index bf0bc74c73b..00000000000 --- a/jstests/getlog2.js +++ /dev/null @@ -1,38 +0,0 @@ -// tests getlog as well as slow querying logging - -glcol = db.getLogTest2; -glcol.drop() - -contains = function(arr, func) { - var i = arr.length; - while (i--) { - if (func(arr[i])) { - return true; - } - } - return false; -} - -// run a slow query -glcol.save({ "SENTINEL": 1 }); -glcol.findOne({ "SENTINEL": 1, "$where": function() { sleep(1000); return true; } }); - -// run a slow update -glcol.update({ "SENTINEL": 1, "$where": function() { sleep(1000); return true; } }, { "x": "x" }); - -var resp = db.adminCommand({getLog:"global"}); -assert( resp.ok == 1, "error executing getLog command" ); -assert( resp.log, "no log field" ); -assert( resp.log.length > 0 , "no log lines" ); - -// ensure that slow query is logged in detail -assert( contains(resp.log, function(v) { - print(v); - return v.indexOf(" query ") != -1 && v.indexOf("query:") != -1 && v.indexOf("SENTINEL") != -1; -}) ); - -// same, but for update -assert( contains(resp.log, function(v) { - print(v); - return v.indexOf(" update ") != -1 && v.indexOf("query:") != -1 && v.indexOf("SENTINEL") != -1; -}) ); |