[SERVER-11125] setProfilingLevel() does not accept zero for slowms parameter Created: 10/Oct/13  Updated: 11/Jul/16  Resolved: 10/Oct/13

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 2.5.3

Type: Bug Priority: Minor - P4
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: performance, profiling, stats
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-5266 Make a clearer API for configuring gl... Backlog
is related to SERVER-4785 slowms should be per database for pro... Backlog
is related to SERVER-457 configure "slow" for query log Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
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 }
Participants:

 Description   

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.



 Comments   
Comment by auto [ 10/Oct/13 ]

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

Comment by Scott Hernandez (Inactive) [ 10/Oct/13 ]

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}

).

Comment by Scott Hernandez (Inactive) [ 10/Oct/13 ]

If this is to set slowms outside of the db profiling then I think we want a new helper or overload.

Comment by Benety Goh [ 10/Oct/13 ]

I should clarify that this is to allow the mongod process to log all queries (assuming the user is aware of the performance hit).

Comment by Scott Hernandez (Inactive) [ 10/Oct/13 ]

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

Generated at Thu Feb 08 03:24:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.