发布于 2015-09-14 14:59:27 | 191 次阅读 | 评论: 0 | 来源: 网络整理

db.setProfilingLevel(level[, slowms])
参数:
  • level – Specifies a profiling level, see list of possible values below.
  • slowms – Optionally modify the threshold for the profile to consider a query or operation “slow.”

Modifies the current database profiler level. This allows administrators to capture data regarding performance. The database profiling system can impact performance and can allow the server to write the contents of queries to the log, which might information security implications for your deployment.

The following profiling levels are available:

Level Setting
0 Off. No profiling.
1 On. Only includes slow operations.
2 On. Includes all operations.

Also configure the slowms option to set the threshold for the profiler to consider a query “slow.” Specify this value in milliseconds to override the default.

This command provides a wrapper around the database command profile.

mongod writes the output of the database profiler to the system.profile collection.

mongod prints information about queries that take longer than the slowms to the log even when the database profiler is not active.

注解

The database cannot be locked with db.fsyncLock() while profiling is enabled. You must disable profiling before locking the database with db.fsyncLock(). Disable profiling using db.setProfilingLevel() as follows in the mongo shell:

db.setProfilingLevel(0)
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务