Skip to content

DOCS-4522: adds new mongotop error message for 2.8 #2096

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

Closed
wants to merge 2 commits into from
Closed
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
13 changes: 11 additions & 2 deletions source/includes/options-mongotop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ inherit:
name: host
program: _shared
file: options-shared.yaml
post: |
If connected to a replica set where the :term:`primary` is not
reachable, {{program}} returns an error message.
---
program: mongotop
name: port
Expand Down Expand Up @@ -128,8 +131,11 @@ inherit:
program: _shared
file: options-shared.yaml
post: |
{{role}} is required for :program:`mongod`
and :program:`mongos` instances that use :ref:`authentication`.


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra whitespace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required for the versionchanged to render properly!

.. versionchanged:: 2.8.0
{{role}} is required for :program:`mongod`
and :program:`mongos` instances that use :ref:`authentication`.
---
program: mongotop
name: authenticationMechanism
Expand Down Expand Up @@ -167,6 +173,9 @@ description: |
Toggles the mode of :program:`mongotop` to report on use of per-database
:ref:`locks <locks>`. These data are useful for measuring concurrent
operations and lock percentage.
post: |
{{role}} returns an error when called against a :program:`mongod` instance
that does not report lock usage.
optional: true
---
program: mongotop
Expand Down
8 changes: 4 additions & 4 deletions source/includes/options-shared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ description: |
connect. By default, the {{program}} attempts to connect to a MongoDB
instance running on the localhost on port number ``27017``.

To connect to a replica set, specify the :setting:`replica set name
<~replication.replSetName>` and a seed list of set members. Use the
following form:
To connect to a replica set, specify the
:setting:`~replication.replSetName` and a seed list of set members, as in
the following:

.. code-block:: none

Expand All @@ -79,7 +79,7 @@ description: |
specifying the host and port number directly.

.. versionchanged:: 2.8.0
If you use IPv6 and use the ``<address>:<port >`` format, you must
If you use IPv6 and use the ``<address>:<port>`` format, you must
enclose the portion of an address and port combination in
brackets (e.g. ``[<address>]``).
optional: false
Expand Down
53 changes: 35 additions & 18 deletions source/reference/program/mongotop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ affect the output of :program:`mongotop`.
and collection.

.. versionchanged:: 2.2
If you use the :option:`--locks`, the :data:`~mongotop.ns` field does not
If you use the :option:`mongotop --locks`, the :data:`~mongotop.ns` field does not
appear in the :program:`mongotop` output.

.. data:: mongotop.db
Expand Down Expand Up @@ -153,6 +153,8 @@ affect the output of :program:`mongotop`.

Provides a time stamp for the returned data.

.. _mongotop-use:

Use
---

Expand All @@ -174,22 +176,32 @@ This command produces the following output:

.. code-block:: sh

connected to: 127.0.0.1

ns total read write 2012-08-13T15:45:40
test.system.namespaces 0ms 0ms 0ms
local.system.replset 0ms 0ms 0ms
local.system.indexes 0ms 0ms 0ms
admin.system.indexes 0ms 0ms 0ms
admin. 0ms 0ms 0ms

ns total read write 2012-08-13T15:45:55
test.system.namespaces 0ms 0ms 0ms
local.system.replset 0ms 0ms 0ms
local.system.indexes 0ms 0ms 0ms
admin.system.indexes 0ms 0ms 0ms
admin. 0ms 0ms 0ms

ns total read write 2014-12-19T15:32:01-05:00
admin.system.roles 0ms 0ms 0ms
admin.system.version 0ms 0ms 0ms
local.me 0ms 0ms 0ms
local.oplog.rs 0ms 0ms 0ms
local.replset.minvalid 0ms 0ms 0ms
local.startup_log 0ms 0ms 0ms
local.system.indexes 0ms 0ms 0ms
local.system.namespaces 0ms 0ms 0ms
local.system.replset 0ms 0ms 0ms

ns total read write 2014-12-19T15:47:01-05:00
admin.system.roles 0ms 0ms 0ms
admin.system.version 0ms 0ms 0ms
local.me 0ms 0ms 0ms
local.oplog.rs 0ms 0ms 0ms
local.replset.minvalid 0ms 0ms 0ms
local.startup_log 0ms 0ms 0ms
local.system.indexes 0ms 0ms 0ms
local.system.namespaces 0ms 0ms 0ms
local.system.replset 0ms 0ms 0ms
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local.system.indexes and local.system.namespaces should only appear in mmapv1? either want to note that or produce an alternate output example?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a note!


The output varies depending on your MongoDB setup. For example,
``local.system.indexes`` and ``local.system.namespaces`` only appear
for :program:`mongod` instances using the :ref:`MMAPv1 <storage-mmapv1>`
storage engine.

To return a :program:`mongotop` report every 5 minutes, use the
following command:
Expand All @@ -198,7 +210,7 @@ following command:

mongotop 300

To report the use of per-database locks, use :option:`mongotop --locks`,
To report the use of per-database locks, use :option:`--locks`,
which produces the following output:

.. code-block:: sh
Expand All @@ -210,3 +222,8 @@ which produces the following output:
local 0ms 0ms 0ms
admin 0ms 0ms 0ms
. 0ms 0ms 0ms

.. versionchanged:: 2.8.0
When called against a :program:`mongod` that does not report lock
usage, :option:`--locks` will return a ``Failed: Server does not
support reporting locking information`` error.