static void _mongoc_monitor_legacy_write (mongoc_client_t *client, mongoc_write_command_t *command, const char *db, const char *collection, mongoc_server_stream_t *stream, int64_t request_id) { bson_t doc; bson_t wc; mongoc_apm_command_started_t event; ENTRY; if (!client->apm_callbacks.started) { EXIT; } bson_init (&doc); _mongoc_write_command_init (&doc, command, collection); BSON_APPEND_DOCUMENT_BEGIN (&doc, "writeConcern", &wc); BSON_APPEND_INT32 (&wc, "w", 0); bson_append_document_end (&doc, &wc); _append_array_from_command (command, &doc); mongoc_apm_command_started_init ( &event, &doc, db, _mongoc_command_type_to_name (command->type), request_id, command->operation_id, &stream->sd->host, stream->sd->id, client->apm_context); client->apm_callbacks.started (&event); mongoc_apm_command_started_cleanup (&event); bson_destroy (&doc); }
static void _mongoc_monitor_legacy_write (mongoc_client_t *client, mongoc_write_command_t *command, const char *db, const char *collection, const mongoc_write_concern_t *write_concern, mongoc_server_stream_t *stream, int64_t request_id) { bson_t doc; mongoc_apm_command_started_t event; ENTRY; if (!client->apm_callbacks.started) { EXIT; } bson_init (&doc); _mongoc_write_command_init (&doc, command, collection, write_concern); _append_array_from_command (command, &doc); mongoc_apm_command_started_init ( &event, &doc, db, _mongoc_command_type_to_name (command->type), request_id, command->operation_id, &stream->sd->host, stream->sd->id, client->apm_context); client->apm_callbacks.started (&event); mongoc_apm_command_started_cleanup (&event); bson_destroy (&doc); }