@@ -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+
156158Use
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
194201To return a :program:`mongotop` report every 5 minutes, use the
195202following 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`,
202209which 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