db.getProfilingStatus()-
Returns:返回The current当前profilelevel,slowOpThresholdMssetting, andslowOpSampleRatesetting.profile级别、slowOpThresholdMs设置和slowOpSampleRate设置。You can set a您可以设置一个filterto control which operations are logged by the profiler.filter来控制分析器记录哪些操作。When set, any configured filters are also returned by设置后,db.getProfilingStatus(), along with anoteexplaining filter behavior.db.getProfilingStatus()也会返回任何配置的筛选器,并附上解释筛选器行为的注释。You can set the profiling filter with either:您可以通过以下任一方式设置分析筛选器:thedb.setProfilingLevel()shell method, ordb.setProfilingLevel()shell方法,或theoperationProfiling.filterconfiguration file option.operationProfiling.filter配置文件选项。
Compatibility兼容性
This method is available in deployments hosted in the following environments:此方法在以下环境中托管的部署中可用:
- MongoDB Atlas
: The fully managed service for MongoDB deployments in the cloud:云中MongoDB部署的完全托管服务
Important
This command is not supported in M0 and Flex clusters. For more information, see Unsupported Commands.M0和Flex集群不支持此命令。有关详细信息,请参阅不支持的命令。
- MongoDB Enterprise
: The subscription-based, self-managed version of MongoDB:MongoDB的基于订阅的自我管理版本 - MongoDB Community
: The source-available, free-to-use, and self-managed version of MongoDB:MongoDB的源代码可用、免费使用和自我管理版本