Skip to content

Commit 8b4d7f1

Browse files
p-mongop
andauthored
RUBY-2289 Display monitoring state in client summary (#2053)
Co-authored-by: Oleg Pudeyev <[email protected]>
1 parent 94d710a commit 8b4d7f1

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

source/tutorials/ruby-driver-create-client.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,39 @@ using the Ruby driver directly. `Mongoid documentation
12601260
however provides examples for closing clients in the parent process and
12611261
reconnecting clients in the child processes.
12621262

1263+
Troubleshooting
1264+
```````````````
1265+
1266+
The client's ``summary`` method returns the current state of the client,
1267+
including servers that the client is monitoring and their state. If any of
1268+
the servers are not being monitored, this is indicated by the ``NO-MONITORING``
1269+
flag.
1270+
1271+
A normally operating client will produce a summary similar to the following:
1272+
1273+
.. code-block:: ruby
1274+
1275+
client.summary
1276+
=> "#<Client cluster=#<Cluster
1277+
topology=ReplicaSetWithPrimary[localhost:14420,localhost:14421,localhost:14422,localhost:14423,name=ruby-driver-rs,v=1,e=7fffffff000000000000001f]
1278+
servers=[#<Server address=localhost:14420 PRIMARY replica_set=ruby-driver-rs pool=#<ConnectionPool size=0 (0-5) used=0 avail=0 pending=0>>,
1279+
#<Server address=localhost:14421 SECONDARY replica_set=ruby-driver-rs pool=#<ConnectionPool size=0 (0-5) used=0 avail=0 pending=0>>,
1280+
#<Server address=localhost:14422 SECONDARY replica_set=ruby-driver-rs pool=#<ConnectionPool size=0 (0-5) used=0 avail=0 pending=0>>,
1281+
#<Server address=localhost:14423 ARBITER replica_set=ruby-driver-rs>]>>"
1282+
1283+
A client that is missing background threads will produce a summary similar to
1284+
the following:
1285+
1286+
.. code-block:: ruby
1287+
1288+
client.summary
1289+
=> "#<Client cluster=#<Cluster
1290+
topology=ReplicaSetWithPrimary[localhost:14420,localhost:14421,localhost:14422,localhost:14423,name=ruby-driver-rs,v=1,e=7fffffff000000000000001f]
1291+
servers=[#<Server address=localhost:14420 PRIMARY replica_set=ruby-driver-rs NO-MONITORING pool=#<ConnectionPool size=0 (0-5) used=0 avail=0 pending=0>>,
1292+
#<Server address=localhost:14421 SECONDARY replica_set=ruby-driver-rs NO-MONITORING pool=#<ConnectionPool size=0 (0-5) used=0 avail=0 pending=0>>,
1293+
#<Server address=localhost:14422 SECONDARY replica_set=ruby-driver-rs NO-MONITORING pool=#<ConnectionPool size=0 (0-5) used=0 avail=0 pending=0>>,
1294+
#<Server address=localhost:14423 ARBITER replica_set=ruby-driver-rs>]>>"
1295+
12631296

12641297
Details on Retryable Reads
12651298
==========================

0 commit comments

Comments
 (0)