This commit implements the following simplifications and improvements:
- The Subscriber ABC has been renamed to CommandListener
- The subscribe function has been renamed to register
- The COMMAND constant has been removed
- The get_subscribers function has been removed
- Command listeners can now be registered per MongoClient instance
instead of just globally
This change adds monitoring of bulk write operations (i.e.
Collection.bulk_write, Collection.insert_many, Collection.insert with multiple
documents, Bulk.execute, etc.). It also fixes bugs in conversion of legacy
write results to write command result format and conversion of legacy queries
to find command documents. Finally, it adds an operation_id attribute to the
published events to tie related events together.
This commit adds support for monitoring queries and getMore
operations, including getMore operations for command cursors
(e.g. aggregate cursor getMore). It also fixes a bug in duration
calculation.
This commit adds support for publishing events when commands
(ismaster, findAndModify, listCollections, etc.) start and
succeed or fail. See the new module, pymongo.monitoring, for
details.
This commit only adds basic infrastructure and support for
monitoring generic commands. Support for monitoring queries,
getMores, killCursors, and write operations are forthcoming.