@@ -401,15 +401,16 @@ Options
401
401
402
402
.. option:: -o=<field list>
403
403
404
- When specified, :program:`mongostat` includes ** only** the specified fields
405
- in the :program:`mongostat` output.
404
+ When output fields are specified with :option:`-o`, only the
405
+ specified fields are included in the :program:`mongostat` output.
406
406
407
407
Use dot notation to specify
408
408
:dbcommand:`serverStatus fields <serverStatus>`, as in
409
409
:serverstatus:`metrics.document.inserted`.
410
410
411
- To specify a custom name for a field, use ``<field>=<customName>``,
412
- as in:
411
+ A custom field name can include spaces. If you include a space, do
412
+ not put additional quotes around the field name. To specify a custom
413
+ name for a field, use ``<field>=<customName>``, as in:
413
414
414
415
.. code-block:: sh
415
416
@@ -425,21 +426,22 @@ Options
425
426
call.
426
427
427
428
:ref:`ex-mongostat-rate` illustrates how to use
428
- :binary:`~bin.mongostat` with :option:`-o <mongostat -o>` and the :method:`.rate()`
429
- method.
429
+ :binary:`~bin.mongostat` with :option:`-o <mongostat -o>` and the
430
+ :method:`.rate()` method.
430
431
431
432
.. method:: .diff()
432
433
433
434
Use :method:`.diff()` to view how much a serverStatus field has
434
- changed since the previous :binary:`~bin.mongostat` call. The interval
435
- between calls is specified by ``<sleeptime>``.
435
+ changed since the previous :binary:`~bin.mongostat` call. The
436
+ interval between calls is specified by ``<sleeptime>``.
436
437
437
438
:ref:`ex-mongostat-diff` illustrates how to use
438
- :binary:`~bin.mongostat` with :option:`-o <mongostat -o>` and the :method:`.diff()`
439
- method.
439
+ :binary:`~bin.mongostat` with :option:`-o <mongostat -o>` and the
440
+ :method:`.diff()` method.
440
441
441
- :program:`mongostat` supports specifying *either* :option:`-o <mongostat -o>` or :option:`-O <mongostat -O>`:
442
- you cannot include both options.
442
+ :program:`mongostat` supports specifying *either* :option:`-o
443
+ <mongostat -o>` or :option:`-O <mongostat -O>`: you cannot include
444
+ both options.
443
445
444
446
See :ref:`ex-mongostat-specify-columns` for an example of
445
447
:option:`-o <mongostat -o>`.
@@ -448,14 +450,16 @@ Options
448
450
.. option:: -O=<field list>
449
451
450
452
When specified, :program:`mongostat` includes the specified
451
- :dbcommand:`serverStatus` fields after the default :program:`mongostat` output.
453
+ :dbcommand:`serverStatus` fields after the default
454
+ :program:`mongostat` output.
452
455
453
456
Use dot notation to specify
454
457
:dbcommand:`serverStatus fields <serverStatus>`, as in
455
458
:serverstatus:`metrics.document.inserted`.
456
459
457
- To specify a custom name for a field, use ``<field>=<customName>``,
458
- as in:
460
+ A custom field name can include spaces. If you include a space, do
461
+ not put additional quotes around the field name. To specify a custom
462
+ name for a field, use ``<field>=<customName>``, as in:
459
463
460
464
.. code-block:: sh
461
465
@@ -721,18 +725,19 @@ behavior:
721
725
Add Fields to :binary:`~bin.mongostat` Output
722
726
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
723
727
724
- :option:`-O <mongostat -O>` allows you to specify fields from
728
+ :option:`-O <mongostat -O>` allows you to specify fields from the
725
729
:dbcommand:`serverStatus` output to add to the default
726
- :binary:`~bin.mongostat` output. The following example adds the :serverstatus:`host`
727
- and :serverstatus:`version` fields as well as the :serverstatus:`network.numRequests` field,
728
- which will display as "network requests", to the default
730
+ :binary:`~bin.mongostat` output. If you include a space in your
731
+ custom filed name, do not put additional quotes around the field name.
732
+
733
+ The following example adds fields to the default
729
734
:binary:`~bin.mongostat` output:
730
735
731
736
.. code-block:: sh
732
737
733
738
mongostat -O='host,version,network.numRequests=network requests'
734
739
735
- The :binary:`~bin.mongostat` output would then resemble :
740
+ The :binary:`~bin.mongostat` output resembles :
736
741
737
742
.. code-block:: sh
738
743
@@ -741,29 +746,62 @@ The :binary:`~bin.mongostat` output would then resemble:
741
746
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 2.51G 19.0M 0|0 0|0 157b 39.3k 2 Oct 11 12:14:46.879 localhost:37017 3.3.14 95
742
747
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 2.51G 19.0M 0|0 0|0 157b 39.2k 2 Oct 11 12:14:47.884 localhost:37017 3.3.14 99
743
748
749
+ The following fields are added to the default output:
750
+
751
+ - :serverstatus:`host`
752
+ - :serverstatus:`version`
753
+ - :serverstatus:`network.numRequests`
754
+
755
+ The :serverstatus:`network.numRequests` field has a custom field name,
756
+ "network requests".
757
+
744
758
.. _ex-mongostat-specify-columns:
745
759
746
760
Specify :binary:`~bin.mongostat` Output Fields
747
761
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
748
762
749
- :option:`-o <mongostat -o>` specifies the columns :binary:`~bin.mongostat` includes in its
750
- output. You can specify any :dbcommand:`serverStatus` field as a
751
- :binary:`~bin.mongostat` output column. The following example specifies the
752
- :serverstatus:`host`, :serverstatus:`time <localTime>`, and :serverstatus:`metrics.document.inserted` fields:
763
+ :option:`-o <mongostat -o>` specifies the columns
764
+ :binary:`~bin.mongostat` includes in its output. You can specify any
765
+ :dbcommand:`serverStatus` field as a :binary:`~bin.mongostat` output
766
+ column.
767
+
768
+ The following example uses custom fields for :binary:`mongostat`:
753
769
754
770
.. code-block:: sh
755
771
756
- mongostat -o='host,time, metrics.document.inserted'
772
+ mongostat --port 27500 - o='host,opcounters.insert.rate()=Insert Rate,opcounters.query.rate()=Query Rate,opcounters.command.rate()=Command Rate,wiredTiger.cache.pages requested from the cache=Pages Req, metrics.document.inserted=inserted rate '
757
773
758
- The :binary:`~bin.mongostat` output would then resemble :
774
+ The :binary:`~bin.mongostat` output resembles :
759
775
760
776
.. code-block:: sh
761
777
762
- host time metrics.document.inserted
763
- localhost:37017 Oct 11 12:21:17.370 0
764
- localhost:37017 Oct 11 12:21:18.371 0
765
- localhost:37017 Oct 11 12:21:19.371 0
766
- localhost:37017 Oct 11 12:21:20.368 0
778
+ host Insert Rate Query Rate Command Rate Pages Req Inserted Rate
779
+ localhost:27500 180 1 8 2999446 9638
780
+ localhost:27500 40 3 12 2999601 9678
781
+ localhost:27500 181 2 9 3000207 9859
782
+ localhost:27500 39 2 12 3000362 9899
783
+ localhost:27500 181 2 11 3000969 10080
784
+ localhost:27500 39 2 10 3001124 10120
785
+
786
+ The counters and corresponding custom field names are:
787
+
788
+ .. list-table::
789
+ :widths: 30 70
790
+ :header-rows: 1
791
+
792
+ * - Counter
793
+ - Custom Field Name
794
+ * - opcounters.insert.rate
795
+ - Insert Rate
796
+ * - opcounters.query.rate
797
+ - Query Rate
798
+ * - opcounters.command.rate
799
+ - Command Rate
800
+ * - wiredTiger.cache.pages requested from the cache
801
+ - Pages Req
802
+ * - metrics.document.inserted
803
+ - Inserted Rate
804
+
767
805
768
806
.. _ex-mongostat-rate:
769
807
0 commit comments