@@ -36,22 +36,22 @@ Subscribe to Events
36
36
-------------------
37
37
38
38
You can access details about SDAM events by subscribing to them
39
- in your application. To subscribe to an event, create a value of
40
- type ``mongoc_apm_callbacks_t`` and create an event callback function
41
- for the event you want to subscribe to. Use the callback's corresponding
42
- setter method to set the callback on the ``mongoc_apm_callbacks_t`` and
43
- pass this type to the ``mongoc_client_set_apm_callbacks()`` function.
39
+ in your application. To subscribe to an event, define an Application
40
+ Performance Monitoring (APM) callback function to handle each event
41
+ type you want to subscribe to. Use a ``mongoc_apm_callbacks_t`` object
42
+ to register the list of APM callbacks with a client using the
43
+ ``mongoc_client_set_apm_callbacks()`` function.
44
44
45
45
This code monitors server opening events by performing the following
46
46
actions:
47
47
48
- - Defines a ``server_opening()`` event handler function, or callback
49
- - Creates a ``mongoc_apm_callbacks_t`` structure to store callbacks
50
- - Calls the ``mongoc_apm_set_server_opening_cb()`` function, which instructs
51
- the ``mongoc_apm_callbacks_t`` type to store a pointer to the ``server_opening()``
52
- callback
48
+ - Defines a ``server_opening()`` APM callback function
49
+ - Creates a ``mongoc_apm_callbacks_t`` object to store callbacks
50
+ - Calls the ``mongoc_apm_set_server_opening_cb()`` function, which
51
+ stores a pointer to the provided APM callback function in the
52
+ ``mongoc_apm_callbacks_t`` object
53
53
- Calls the ``mongoc_client_set_apm_callbacks()`` function, which registers
54
- the callback with the client
54
+ the callback in the ``mongoc_apm_callbacks_t`` object with the client
55
55
56
56
.. literalinclude:: /includes/monitoring/sdam.c
57
57
:language: c
0 commit comments