Skip to content

Commit 00446c7

Browse files
author
Dave Cuthbert
authored
DOCSP-30248 clear profile (#3525)
* DOCSP-302248 unset profile filter * DOCSP-302248 unset profile filter * DOCSP-302248 unset profile filter * DOCSP-302248 unset profile filter * DOCSP-302248 unset profile filter * DOCSP-302248 unset profile filter
1 parent e39a646 commit 00446c7

File tree

3 files changed

+43
-14
lines changed

3 files changed

+43
-14
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The operation returns a document with the **previous** values for the
2+
settings.
3+
4+
To view the current profiling level, see
5+
:method:`db.getProfilingStatus()`.

source/reference/command/profile.txt

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ profile
99
.. contents:: On this page
1010
:local:
1111
:backlinks: none
12-
:depth: 1
12+
:depth: 2
1313
:class: singlecol
1414

1515
Definition
@@ -190,7 +190,10 @@ command against the ``admin`` database.
190190
Example
191191
-------
192192

193-
Enable profiling and filter the logged data:
193+
Enable Filtering
194+
~~~~~~~~~~~~~~~~
195+
196+
To enable profiling and filter the logged data:
194197

195198
.. code-block:: javascript
196199

@@ -214,3 +217,20 @@ are:
214217
- at least ``100`` milliseconds long, or
215218
- submitted by the ``testuser``.
216219

220+
Unset a Filter
221+
~~~~~~~~~~~~~~
222+
223+
To clear a profile filter, run ``profile`` with the ``filter: "unset"``
224+
option.
225+
226+
.. code-block:: javascript
227+
228+
db.runCommand(
229+
{
230+
profile: 1,
231+
filter: "unset"
232+
}
233+
)
234+
235+
.. include:: /includes/reference/return-set-profile.rst
236+

source/reference/method/db.setProfilingLevel.txt

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ db.setProfilingLevel()
77
.. contents:: On this page
88
:local:
99
:backlinks: none
10-
:depth: 1
10+
:depth: 2
1111
:class: singlecol
1212

1313
.. |binary| replace:: :binary:`~bin.mongod` or :binary:`~bin.mongos`
@@ -356,10 +356,7 @@ The following example sets for a :binary:`~bin.mongod` instance:
356356

357357
db.setProfilingLevel(1, { slowms: 20, sampleRate: 0.42 })
358358

359-
The method returns a document with the **previous** values for the
360-
settings.
361-
362-
To view the current profiling level, see :method:`db.getProfilingStatus()`.
359+
.. include:: /includes/reference/return-set-profile.rst
363360

364361
Disable Profiler and Set Slow Operation Threshold and Sample Rate
365362
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -379,10 +376,7 @@ The following example sets for a :binary:`~bin.mongod` or
379376

380377
db.setProfilingLevel(0, { slowms: 20, sampleRate: 0.42 })
381378

382-
The method returns a document with the **previous** values for the
383-
settings.
384-
385-
To view the current profiling level, see :method:`db.getProfilingStatus()`.
379+
.. include:: /includes/reference/return-set-profile.rst
386380

387381
.. _profiler-filter-example:
388382

@@ -403,7 +397,17 @@ The following example sets for a :binary:`~bin.mongod` instance:
403397

404398
db.setProfilingLevel( 1, { filter: { op: "query", millis: { $gt: 2000 } } } )
405399

406-
The method returns a document with the **previous** values for the
407-
settings.
400+
.. include:: /includes/reference/return-set-profile.rst
401+
402+
Unset a Filter
403+
~~~~~~~~~~~~~~
404+
405+
To clear a profile filter, run ``db.setProfilingLevel()`` with the
406+
``filter: "unset"`` option.
407+
408+
.. code-block:: javascript
409+
410+
db.setProfilingLevel( 1, { filter: "unset" } )
411+
412+
.. include:: /includes/reference/return-set-profile.rst
408413

409-
To view the current profiling level, see :method:`db.getProfilingStatus()`.

0 commit comments

Comments
 (0)