Skip to content

Commit d6993f8

Browse files
committed
DOCS-10953: adds --interactive option to mongostat reference
1 parent 2baacd8 commit d6993f8

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

source/includes/options-mongostat.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,19 @@ post: |
364364
See :ref:`ex-mongostat-specify-columns` for an example of
365365
{{role}}.
366366
optional: true
367+
---
368+
program: mongostat
369+
name: interactive
370+
directive: option
371+
args: null
372+
pre: |
373+
.. versionadded:: 3.4
374+
description: |
375+
Display {{program}} output in an interactive non-scrolling interface
376+
rather than the default scrolling output.
377+
378+
{{role}} is not available with the :option:`--json <mongostat --json>`
379+
option.
380+
post: |
381+
See: :ref:`example-mongostat-interactive` for an example of {{role}}.
367382
...

source/reference/program/mongostat.txt

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,16 @@ Options
112112

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

115-
.. include:: /includes/option/option-mongostat-http.rst
116-
117115
.. include:: /includes/option/option-mongostat-discover.rst
118116

117+
.. include:: /includes/option/option-mongostat-http.rst
118+
119119
.. include:: /includes/option/option-mongostat-all.rst
120120

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

123+
.. include:: /includes/option/option-mongostat-interactive.rst
124+
123125
.. include:: /includes/option/option-mongostat-<sleeptime>.rst
124126

125127
.. _mongostat-fields:
@@ -508,3 +510,37 @@ members of the cluster:
508510
.. code-block:: sh
509511

510512
mongostat --discover
513+
514+
.. _example-mongostat-interactive:
515+
516+
View Statistics in an Interactive Interface
517+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
518+
519+
.. versionadded:: 3.4
520+
521+
Use the :option:`--interactive <mongostat --interactive>` option to
522+
view statistics in a non-scrolling `ncurses<https://www.gnu.org/software/ncurses/>`_-style
523+
interactive output. The :option:`--interactive` option lets you highlight specific
524+
hosts, columns, or fields to view. When combined with :option:`--discover`,
525+
:option:`--interactive` displays statistics for all members of a
526+
replica set or sharded cluster, as in the following example:
527+
528+
.. code-block:: sh
529+
530+
mongostat --discover --interactive
531+
532+
The output for a sharded cluster would then resemble:
533+
534+
.. code-block:: sh
535+
536+
host insert query update delete getmore command dirty used flushes mapped vsize res faults qrw arw net_in net_out conn set repl time
537+
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
538+
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
539+
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
540+
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
541+
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
542+
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
543+
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
544+
545+
Press '?' to toggle help
546+

0 commit comments

Comments
 (0)