Skip to content

DOCS-10953: adds --interactive option to mongostat reference #3164

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
Jan 30, 2018
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
15 changes: 15 additions & 0 deletions source/includes/options-mongostat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,19 @@ post: |
See :ref:`ex-mongostat-specify-columns` for an example of
{{role}}.
optional: true
---
program: mongostat
name: interactive
directive: option
args: null
pre: |
.. versionadded:: 3.4
description: |
Display {{program}} output in an interactive non-scrolling interface
rather than the default scrolling output.

{{role}} is not available with the :option:`--json <mongostat --json>`
option.
post: |
See: :ref:`example-mongostat-interactive` for an example of {{role}}.
...
40 changes: 38 additions & 2 deletions source/reference/program/mongostat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,16 @@ Options

.. include:: /includes/option/option-mongostat-rowcount.rst

.. include:: /includes/option/option-mongostat-http.rst

.. include:: /includes/option/option-mongostat-discover.rst

.. include:: /includes/option/option-mongostat-http.rst

.. include:: /includes/option/option-mongostat-all.rst

.. include:: /includes/option/option-mongostat-json.rst

.. include:: /includes/option/option-mongostat-interactive.rst

.. include:: /includes/option/option-mongostat-<sleeptime>.rst

.. _mongostat-fields:
Expand Down Expand Up @@ -508,3 +510,37 @@ members of the cluster:
.. code-block:: sh

mongostat --discover

.. _example-mongostat-interactive:

View Statistics in an Interactive Interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 3.4

Use the :option:`--interactive <mongostat --interactive>` option to
view statistics in a non-scrolling `ncurses<https://www.gnu.org/software/ncurses/>`_-style
interactive output. The :option:`--interactive` option lets you highlight specific
hosts, columns, or fields to view. When combined with :option:`--discover`,
:option:`--interactive` displays statistics for all members of a
replica set or sharded cluster, as in the following example:

.. code-block:: sh

mongostat --discover --interactive

The output for a sharded cluster would then resemble:

.. code-block:: sh

host insert query update delete getmore command dirty used flushes mapped vsize res faults qrw arw net_in net_out conn set repl time
hostname.local:27018 *0 *0 *0 *0 0 1|0 0.0% 0.0% 0 3.25G 25.0M n/a 0|0 1|0 157b 43.9k 19 tic PRI Nov 2 11:44:46.439
hostname.local:27019 *0 *0 *0 *0 0 2|0 0.0% 0.0% 0 3.18G 26.0M n/a 0|0 1|0 322b 44.4k 12 tic SEC Nov 2 11:44:46.439
hostname.local:27020 *0 *0 *0 *0 0 2|0 0.0% 0.0% 0 3.18G 26.0M n/a 0|0 1|0 322b 44.4k 12 tic SEC Nov 2 11:44:46.439
hostname.local:27021 2017 *0 *0 *0 826 1029|0 0.0% 0.0% 0 3.25G 31.0M n/a 0|0 1|0 1.74m 1.60m 20 tac PRI Nov 2 11:44:46.439
hostname.local:27022 *2021 *0 *0 *0 0 2|0 0.0% 0.0% 0 3.19G 32.0M n/a 0|0 1|0 322b 44.6k 12 tac SEC Nov 2 11:44:46.438
hostname.local:27023 *2022 *0 *0 *0 0 3|0 0.0% 0.0% 0 3.19G 33.0M n/a 0|0 1|0 323b 44.7k 12 tac SEC Nov 2 11:44:46.438
localhost:27017 2071 *0 *0 *0 0 2073|0 0 0B 2.43G 9.00M 0 0|0 0|0 249k 130k 4 RTR Nov 2 11:44:47.429

Press '?' to toggle help