Skip to content

DOCS-13884 Log profiler changes #5011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions source/includes/log-changes-to-database-profiler.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Starting in MongoDB 4.0.22, changes made to the :ref:`database profiler
<database-profiler>` profile level, ``slowms``, or ``sampleRate``
using the :dbcommand:`profile` command or
:method:`db.setProfilingLevel()` wrapper method are recorded in the
:option:`log file <mongod --logpath>`.
4 changes: 3 additions & 1 deletion source/reference/command/profile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Definition

.. dbcommand:: profile

.. versionchanged:: 4.0
.. versionchanged:: 4.0.22

The command can be run on :binary:`~bin.mongos` with ``profile``
level:
Expand All @@ -42,6 +42,8 @@ Definition

.. include:: /includes/warning-profiler-performance.rst

.. include:: /includes/log-changes-to-database-profiler.rst

The :dbcommand:`profile` command has the following syntax:

.. code-block:: javascript
Expand Down
20 changes: 11 additions & 9 deletions source/reference/method/db.setProfilingLevel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ Definition
<set-profiling-level-options-sampleRate>`.

If the :ref:`database profiler level <set-profiling-level-level>` is
``1`` or ``2`` (i.e. the :doc:`database profiler
``1`` or ``2`` (specifically, the :doc:`database profiler
</tutorial/manage-the-database-profiler/>` is enabled), the
:ref:`slowms <set-profiling-level-options-slowms>` and the
:ref:`sampleRate <set-profiling-level-options-sampleRate>` affect
the behavior of both the profiler and the :option:`diagnostic log
<mongod --logpath>`.

If the :ref:`database profiler level <set-profiling-level-level>` is
``0`` (i.e. :doc:`database profiler
``0`` (specifically, :doc:`database profiler
</tutorial/manage-the-database-profiler/>` is disabled), the
:ref:`slowms <set-profiling-level-options-slowms>` and the
:ref:`sampleRate <set-profiling-level-options-sampleRate>` affect
Expand All @@ -48,6 +48,8 @@ Definition
:method:`db.setProfilingLevel()` provides a wrapper around the
:dbcommand:`profile` command.

.. include:: /includes/log-changes-to-database-profiler.rst

Syntax
~~~~~~

Expand Down Expand Up @@ -83,7 +85,7 @@ Parameters

.. include:: /includes/database-profiler-levels.rst

Since profiling is not available on :binary:`~bin.mongos`,
Because profiling is not available on :binary:`~bin.mongos`,
:method:`db.setProfilingLevel()` cannot be used to set the profiling
level to a value other than ``0`` on a :binary:`~bin.mongos` instance.

Expand Down Expand Up @@ -114,9 +116,9 @@ Parameters
For :binary:`~bin.mongod` instances, the setting affects both the
diagnostic log and, if enabled, the profiler.

For :binary:`~bin.mongos` instances, the setting affects the
diagnostic log only and not the profiler since profiling is not
available on :binary:`~bin.mongos`.
For :binary:`~bin.mongos` instances, the setting affects
the diagnostic log only and not the profiler because
profiling is not available on :binary:`~bin.mongos`.

.. note::
This argument affects the same setting as the configuration
Expand All @@ -135,9 +137,9 @@ Parameters
For :binary:`~bin.mongod` instances, the setting affects both the
diagnostic log and, if enabled, the profiler.

For :binary:`~bin.mongos` instances, the setting affects the
diagnostic log only and not the profiler since profiling is not
available on :binary:`~bin.mongos`.
For :binary:`~bin.mongos` instances, the setting affects
the diagnostic log only and not the profiler because
profiling is not available on :binary:`~bin.mongos`.

.. note::
This argument affects the same setting as the configuration option
Expand Down
5 changes: 3 additions & 2 deletions source/tutorial/manage-the-database-profiler.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ When enabled, profiling has an effect on database performance and
disk use. See :ref:`Database Profiler Overhead<database-profiling-overhead>` for more information.

This document outlines a number of key administration options for the
database profiler. For additional related information, consider the
following resources:
database profiler. For additional related information, see:

- :doc:`/reference/database-profiler`
- :doc:`Profile Command </reference/command/profile>`
Expand Down Expand Up @@ -86,6 +85,8 @@ The ``"ok" : 1`` key-value pair indicates the operation succeeded:
To verify the new setting, see the
:ref:`database-profiling-view-status` section.

.. include:: /includes/log-changes-to-database-profiler.rst

.. _database-profiling-specify-slowms-threshold:

Specify the Threshold for Slow Operations
Expand Down