Skip to content

Commit 285ba25

Browse files
asya999kay-kim
authored andcommitted
sampleRate is global
sampleRate is global, just as slowms so changing the wording to make it clear.
1 parent bc28b9b commit 285ba25

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

source/tutorial/manage-the-database-profiler.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ Profile a Random Sample of Slow Operations
122122

123123
.. versionadded:: 3.6
124124

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:
127127

128128
- Set the value of ``sampleRate`` using the :dbcommand:`profile` command
129129
or :method:`db.setProfilingLevel()` shell helper method.
@@ -135,9 +135,9 @@ specific database, specify the desired sample rate in one of the following ways:
135135
:ref:`configuration file <configuration-options>`.
136136

137137
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``.
141141

142142
For example, the following method sets the profiling level for the
143143
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
146146

147147
db.setProfilingLevel(1, { sampleRate: 0.42 })
148148

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+
149154
.. important::
150155
.. include:: /includes/fact-log-slow-queries.rst
151156

0 commit comments

Comments
 (0)