Info
mongod accepts --slowms=0 but the shell command db.setProfiliingLevel(level, slowms) does not. Can we fix the shell command to support slowms=0?
Also, are negative values supported for slowms? This would allow the server to log all queries.
Top User Comments
auto commented on Thu, 10 Oct 2013 21:34:36 +0000:
Author:
{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}
Message: SERVER-11125 updated db.setProfilingLevel() to accept zero for slowms
Branch: master
https://github.com/mongodb/mongo/commit/dd4b720028801ca6dfc8ee9e7051e6557d569c41
scotthernandez commented on Thu, 10 Oct 2013 21:19:36 +0000:
after chatting I see that the issue is a bit conflated since slowms is used for both logging and database profiling (to system.profile collection) but the current javascript helper simply won't allow putting the value to 0 without calling the command manually (
{profile:lvl, slowms:0}
).
scotthernandez commented on Thu, 10 Oct 2013 20:52:23 +0000:
If this is to set slowms outside of the db profiling then I think we want a new helper or overload.
benety.goh commented on Thu, 10 Oct 2013 20:49:00 +0000:
I should clarify that this is to allow the mongod process to log all queries (assuming the user is aware of the performance hit).
scotthernandez commented on Thu, 10 Oct 2013 19:11:43 +0000:
Level 2 logs all operations. slowms=0 should not do this (it should really be disallowed in the command line opt)
http://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/#profiling-levels
Steps to Reproduce
Start up mongod with default profiling values.
At shell, run the following commands
> db.setProfilingLevel(1, 0)
{ "was" : 0, "slowms" : 100, "ok" : 1 }
> db.getProfilingStatus()
{ "was" : 1, "slowms" : 100 }
The result from db.getProfilingStatus() should be
{ "was" : 1, "slowms" : 0 }