db.getProfilingStatus()
db.getProfilingStatus()
-
Returns:返回值:The current当前profile
level,slowOpThresholdMs
setting, andslowOpSampleRate
setting.profile
级别、slowOpThresholdMs
设置和slowOpSampleRate
设置。Starting in MongoDB 4.4.2, you can set a从MongoDB 4.4.2开始,您可以设置一个filter
to control which operations are logged by the profiler.filter
来控制探查器记录哪些操作。When set, any configured filters are also returned by设置后,db.getProfilingStatus()
, along with anote
explaining filter behavior.db.getProfilingStatus()
还会返回任何配置的筛选器,并附带一条说明筛选器行为的注释。
You can set the profiling filter with either:您可以使用以下任一项设置分析筛选器:thedb.setProfilingLevel()
shell method, ordb.setProfilingLevel()
shell方法,或theoperationProfiling.filter
configuration file option.operationProfiling.filter
配置文件选项。