@@ -81,7 +81,7 @@ To monitor command events, create a class that implements the
81
81
``CommandListener`` interface and register an instance of that class with your
82
82
``MongoClient`` instance.
83
83
84
- For more information about MongoDB database commands, see :manual:`</reference/command/>`
84
+ For more information about MongoDB database commands, see :manual:`Database Commands </reference/command/>`
85
85
in the {+mdb-server+} manual.
86
86
87
87
.. note:: Internal Commands
@@ -135,9 +135,11 @@ counter.
135
135
:language: java
136
136
:start-after: start-monitor-command-example
137
137
:end-before: end-monitor-command-example
138
+ :dedent:
138
139
139
140
.. output::
140
-
141
+ :visible: false
142
+
141
143
{find=1}
142
144
{find=2}
143
145
{find=2, endSessions=1}
@@ -153,10 +155,10 @@ The driver defines nine SDAM events. The driver divides these nine events
153
155
between three separate listener interfaces which each listen for three of the
154
156
nine events. Here are the three interfaces and the events they listen for:
155
157
156
- - ``ClusterListener``: :spec:`topology </server-discovery-and-monitoring/server-discovery-and-monitoring.md#topology>`
157
- related events
158
+ - ``ClusterListener``: :spec:`topology </server-discovery-and-monitoring/server-discovery-and-monitoring.md#topology>`-related
159
+ events
158
160
- ``ServerListener``: events related to ``mongod`` or ``mongos`` processes
159
- - ``ServerMonitorListener``: heartbeat related events
161
+ - ``ServerMonitorListener``: heartbeat- related events
160
162
161
163
To monitor a type of SDAM event, write a class that
162
164
implements one of the three preceding interfaces and register an instance of that
@@ -172,7 +174,7 @@ For a detailed description of each SDAM event in the driver, see the
172
174
Example
173
175
^^^^^^^
174
176
175
- This example shows how to make a listener class that prints a message that lets
177
+ The following example shows how to make a listener class that prints a message that lets
176
178
you know if the driver can write to your MongoDB instance.
177
179
178
180
The following code defines the ``IsWritable`` class which implements the
@@ -199,16 +201,10 @@ The following code adds an instance of the ``IsWritable`` class to a
199
201
:dedent:
200
202
201
203
.. output::
204
+ :visible: false
202
205
203
206
Able to write to server
204
207
205
- - `ClusterListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ClusterListener.html>`__
206
- - `ServerListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ServerListener.html>`__
207
- - `ServerMonitorListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ServerMonitorListener.html>`__
208
- - `MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__
209
- - `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__
210
- - `ClusterDescriptionChangedEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ClusterDescriptionChangedEvent.html>`__
211
-
212
208
Connection Pool Events
213
209
~~~~~~~~~~~~~~~~~~~~~~
214
210
@@ -252,6 +248,7 @@ librarian.
252
248
:dedent:
253
249
254
250
.. output::
251
+ :visible: false
255
252
256
253
Let me get you the connection with id 21...
257
254
@@ -324,8 +321,8 @@ following resources from Oracle:
324
321
JMX and JConsole Example
325
322
~~~~~~~~~~~~~~~~~~~~~~~~
326
323
327
- This example shows how you can monitor the driver's connection pools using JMX
328
- and **JConsole**. JConsole is a JMX compliant GUI monitoring tool that comes with
324
+ The following example shows how you can monitor the driver's connection pools using JMX
325
+ and **JConsole**. JConsole is a JMX- compliant GUI monitoring tool that comes with
329
326
the Java Platform.
330
327
331
328
.. tip:: Consult the Official JMX and JConsole Documentation
@@ -334,7 +331,7 @@ the Java Platform.
334
331
rather than a source of truth. For guaranteed up to date information, consult
335
332
the following official Oracle resources:
336
333
337
- - `JConsole documentation <https://www.oracle.com/technical-resources/articles/java/jconsole.html>`__.
334
+ - `JConsole documentation <https://www.oracle.com/technical-resources/articles/java/jconsole.html>`__
338
335
- `JMX documentation <https://docs.oracle.com/javase/tutorial/jmx/index.html>`__
339
336
340
337
The following code snippet adds a ``JMXConnectionPoolListener`` to a
@@ -351,6 +348,7 @@ navigate to JConsole and inspect your connection pools.
351
348
:dedent:
352
349
353
350
.. output::
351
+ :visible: false
354
352
355
353
Navigate to JConsole to see your connection pools...
356
354
@@ -377,7 +375,7 @@ following:
377
375
For more information about JMX and JConsole, see the following resources from
378
376
Oracle:
379
377
380
- - `JConsole Documentation <https://www.oracle.com/technical-resources/articles/java/jconsole.html>`__.
378
+ - `JConsole Documentation <https://www.oracle.com/technical-resources/articles/java/jconsole.html>`__
381
379
- `Monitoring and Management Guide <https://docs.oracle.com/en/java/javase/16/management/monitoring-and-management-using-jmx-technology.html>`__
382
380
383
381
For more information about the ``JMXConnectionPoolListener`` class, see
@@ -420,14 +418,14 @@ API Documentation
420
418
For more information about the classes and methods mentioned in this document, see
421
419
the following API Documentation:
422
420
423
- - `MongoClient <{+api+}/mongodb-driver-sync /com/mongodb/client/MongoClient .html>`__
421
+ - `MongoClients <{+api+}/mongodb-driver-reactivestreams /com/mongodb/reactivestreams/ client/MongoClients .html>`__
424
422
- `MongoClientSettings <{+api+}/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__
425
423
- `CommandListener <{+api+}/mongodb-driver-core/com/mongodb/event/CommandListener.html>`__
426
424
- `CommandStartedEvent <{+api+}/mongodb-driver-core/com/mongodb/event/CommandStartedEvent.html>`__
427
425
- `CommandSucceededEvent <{+api+}/mongodb-driver-core/com/mongodb/event/CommandSucceededEvent.html>`__
428
426
- `CommandFailedEvent <{+api+}/mongodb-driver-core/com/mongodb/event/CommandFailedEvent.html>`__
429
- - `ClusterListener <{+api+}/apidocs/ mongodb-driver-core/com/mongodb/event/ClusterListener.html>`__
430
- - `ClusterDescriptionChangedEvent <{+api+}/apidocs/ mongodb-driver-core/com/mongodb/event/ClusterDescriptionChangedEvent.html>`__
431
- - `ConnectionPoolListener <{+api+}/apidocs/ mongodb-driver-core/com/mongodb/event/ConnectionPoolListener.html>`__
432
- - `ConnectionCheckedOutEvent <{+api+}/apidocs/ mongodb-driver-core/com/mongodb/event/ConnectionCheckedOutEvent.html>`__
433
- - `ConnectionCheckOutFailedEvent <{+api+}/apidocs/ mongodb-driver-core/com/mongodb/event/ConnectionCheckOutFailedEvent.html>`__
427
+ - `ClusterListener <{+api+}/mongodb-driver-core/com/mongodb/event/ClusterListener.html>`__
428
+ - `ClusterDescriptionChangedEvent <{+api+}/mongodb-driver-core/com/mongodb/event/ClusterDescriptionChangedEvent.html>`__
429
+ - `ConnectionPoolListener <{+api+}/mongodb-driver-core/com/mongodb/event/ConnectionPoolListener.html>`__
430
+ - `ConnectionCheckedOutEvent <{+api+}/mongodb-driver-core/com/mongodb/event/ConnectionCheckedOutEvent.html>`__
431
+ - `ConnectionCheckOutFailedEvent <{+api+}/mongodb-driver-core/com/mongodb/event/ConnectionCheckOutFailedEvent.html>`__
0 commit comments