Skip to content

Commit 9002f41

Browse files
committed
DOCS-4522: mongotop only reports activity on primary in 2.8
Signed-off-by: Allison Moore <[email protected]>
1 parent 34fb2ea commit 9002f41

File tree

3 files changed

+77
-22
lines changed

3 files changed

+77
-22
lines changed

source/includes/options-mongotop.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ inherit:
3636
name: host
3737
program: _shared
3838
file: options-shared.yaml
39+
post: |
40+
41+
42+
.. versionchanged:: 2.8.0
43+
If connected to a replica set, {{program}} only reports activity
44+
on the :term:`primary`. {{program}} will not include activity on
45+
the :term:`secondaries <secondary>`.
46+
If the :term:`primary` is not reachable, {{program}} returns an
47+
error message. See:
48+
:ref:`Use with Replica Sets <mongotop-use-replicasets>`
49+
for more information.
3950
---
4051
program: mongotop
4152
name: port

source/includes/options-shared.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ description: |
6767
connect. By default, the {{program}} attempts to connect to a MongoDB
6868
instance running on the localhost on port number ``27017``.
6969
70-
To connect to a replica set, specify the :setting:`replica set name
71-
<~replication.replSetName>` and a seed list of set members. Use the
72-
following form:
70+
To connect to a replica set, specify the
71+
:setting:`~replication.replSetName` and a seed list of set members, as in
72+
the following:
7373
7474
.. code-block:: none
7575
@@ -79,7 +79,7 @@ description: |
7979
specifying the host and port number directly.
8080
8181
.. versionchanged:: 2.8.0
82-
If you use IPv6 and use the ``<address>:<port >`` format, you must
82+
If you use IPv6 and use the ``<address>:<port>`` format, you must
8383
enclose the portion of an address and port combination in
8484
brackets (e.g. ``[<address>]``).
8585
optional: false

source/reference/program/mongotop.txt

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ affect the output of :program:`mongotop`.
121121
and collection.
122122

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

127127
.. data:: mongotop.db
@@ -153,6 +153,8 @@ affect the output of :program:`mongotop`.
153153

154154
Provides a time stamp for the returned data.
155155

156+
.. _mongotop-use:
157+
156158
Use
157159
---
158160

@@ -174,22 +176,27 @@ This command produces the following output:
174176

175177
.. code-block:: sh
176178

177-
connected to: 127.0.0.1
178-
179-
ns total read write 2012-08-13T15:45:40
180-
test.system.namespaces 0ms 0ms 0ms
181-
local.system.replset 0ms 0ms 0ms
182-
local.system.indexes 0ms 0ms 0ms
183-
admin.system.indexes 0ms 0ms 0ms
184-
admin. 0ms 0ms 0ms
185-
186-
ns total read write 2012-08-13T15:45:55
187-
test.system.namespaces 0ms 0ms 0ms
188-
local.system.replset 0ms 0ms 0ms
189-
local.system.indexes 0ms 0ms 0ms
190-
admin.system.indexes 0ms 0ms 0ms
191-
admin. 0ms 0ms 0ms
192-
179+
ns total read write 2014-12-19T15:32:01-05:00
180+
admin.system.roles 0ms 0ms 0ms
181+
admin.system.version 0ms 0ms 0ms
182+
local.me 0ms 0ms 0ms
183+
local.oplog.rs 0ms 0ms 0ms
184+
local.replset.minvalid 0ms 0ms 0ms
185+
local.startup_log 0ms 0ms 0ms
186+
local.system.indexes 0ms 0ms 0ms
187+
local.system.namespaces 0ms 0ms 0ms
188+
local.system.replset 0ms 0ms 0ms
189+
190+
ns total read write 2014-12-19T15:47:01-05:00
191+
admin.system.roles 0ms 0ms 0ms
192+
admin.system.version 0ms 0ms 0ms
193+
local.me 0ms 0ms 0ms
194+
local.oplog.rs 0ms 0ms 0ms
195+
local.replset.minvalid 0ms 0ms 0ms
196+
local.startup_log 0ms 0ms 0ms
197+
local.system.indexes 0ms 0ms 0ms
198+
local.system.namespaces 0ms 0ms 0ms
199+
local.system.replset 0ms 0ms 0ms
193200

194201
To return a :program:`mongotop` report every 5 minutes, use the
195202
following command:
@@ -198,7 +205,7 @@ following command:
198205

199206
mongotop 300
200207

201-
To report the use of per-database locks, use :option:`mongotop --locks`,
208+
To report the use of per-database locks, use :option:`--locks`,
202209
which produces the following output:
203210

204211
.. code-block:: sh
@@ -210,3 +217,40 @@ which produces the following output:
210217
local 0ms 0ms 0ms
211218
admin 0ms 0ms 0ms
212219
. 0ms 0ms 0ms
220+
221+
.. _mongotop-use-replicasets:
222+
223+
.. versionchanged:: 2.8.0
224+
When connected to a replica set, :program:`mongotop` only reports activity
225+
on the :term:`primary`. :program:`mongotop` will not include activity on
226+
the :term:`secondaries <secondary>`.
227+
228+
If the :term:`primary` is not reachable or no members of the seed list
229+
are part of the specified replica set, :program:`mongotop` returns an
230+
error, as in the following output:
231+
232+
.. code-block:: sh
233+
234+
ns total read write 2014-12-19T15:31:45-05:00
235+
admin.system.roles 0ms 0ms 0ms
236+
admin.system.version 0ms 0ms 0ms
237+
local.me 0ms 0ms 0ms
238+
local.oplog.rs 0ms 0ms 0ms
239+
local.replset.minvalid 0ms 0ms 0ms
240+
local.startup_log 0ms 0ms 0ms
241+
local.system.replset 0ms 0ms 0ms
242+
243+
2014-12-19T15:31:51.824-0500 Error: no reachable servers
244+
245+
2014-12-19T15:31:57.834-0500 Error: no reachable servers
246+
247+
ns total read write 2014-12-19T15:32:01-05:00
248+
admin.system.roles 0ms 0ms 0ms
249+
admin.system.version 0ms 0ms 0ms
250+
local.me 0ms 0ms 0ms
251+
local.oplog.rs 0ms 0ms 0ms
252+
local.replset.minvalid 0ms 0ms 0ms
253+
local.startup_log 0ms 0ms 0ms
254+
local.system.indexes 0ms 0ms 0ms
255+
local.system.namespaces 0ms 0ms 0ms
256+
local.system.replset 0ms 0ms 0ms

0 commit comments

Comments
 (0)