@@ -122,8 +122,8 @@ Profile a Random Sample of Slow Operations
122
122
123
123
.. versionadded:: 3.6
124
124
125
- To profile only a randomly sampled subset of all *slow* operations on a
126
- specific database, specify the desired sample rate in one of the following ways:
125
+ To profile only a randomly sampled subset of all *slow* operations, specify the
126
+ desired sample rate in one of the following ways:
127
127
128
128
- Set the value of ``sampleRate`` using the :dbcommand:`profile` command
129
129
or :method:`db.setProfilingLevel()` shell helper method.
@@ -135,9 +135,9 @@ specific database, specify the desired sample rate in one of the following ways:
135
135
:ref:`configuration file <configuration-options>`.
136
136
137
137
By default, ``sampleRate`` is set to ``1.0``, meaning all *slow*
138
- operations are profiled. Databases with a ``sampleRate`` between 0 and 1
139
- will only profile a randomly sampled percentage of *slow* operations
140
- according to ``sampleRate``.
138
+ operations are profiled. When ``sampleRate`` is set between 0 and 1
139
+ databases with profiling level ``1`` will only profile a randomly sampled
140
+ percentage of *slow* operations according to ``sampleRate``.
141
141
142
142
For example, the following method sets the profiling level for the
143
143
current database to ``1`` and sets the profiler to sample 42% of all *slow* operations:
@@ -146,6 +146,11 @@ current database to ``1`` and sets the profiler to sample 42% of all *slow* oper
146
146
147
147
db.setProfilingLevel(1, { sampleRate: 0.42 })
148
148
149
+ .. important::
150
+ The sample rate value applies to all databases in a
151
+ :binary:`~bin.mongod` instance. It is used by both the database profiler
152
+ and the system log
153
+
149
154
.. important::
150
155
.. include:: /includes/fact-log-slow-queries.rst
151
156
0 commit comments