The MongoDB\Driver\Monitoring\CommandSucceededEvent class
(mongodb >=1.3.0)
Introduction
The MongoDB\Driver\Monitoring\CommandSucceededEvent class encapsulates information about a successful command.
Class synopsis
Properties
hostThe hostname of the server that executed the command.
portThe port of the server that executed the command.
commandNameThe command name.
databaseNameThe database name.
durationThe duration of the command in microseconds. The duration is a calculated value that includes the time to send the message and receive the response from the server.
replyThe reply document returned by the server.
operationIdThe operation ID. This may be used to link events together such as bulk writes, which may dispatch multiple commands.
requestIdThe request ID. This may be used to associate this MongoDB\Driver\Monitoring\CommandSucceededEvent with a corresponding MongoDB\Driver\Monitoring\CommandStartedEvent.
serviceId
The service ID, or null if the server does not support it (i.e.
not using load-balanced mode).
The server connection ID, or null if not available.
Changelog
| Version | Description |
|---|---|
| PECL mongodb 2.3.0 | Added public readonly properties. The duration property replaces the getDurationMicros() method. |
Table of Contents
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getCommandName — Returns the command name
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getDatabaseName — Returns the database on which the command was executed
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getDurationMicros — Returns the command's duration in microseconds
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getHost — Returns the server hostname for the command
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getOperationId — Returns the command's operation ID
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getPort — Returns the server port for the command
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getReply — Returns the command reply document
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getRequestId — Returns the command's request ID
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getServer — Returns the Server on which the command was executed
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getServerConnectionId — Returns the server connection ID for the command
- MongoDB\Driver\Monitoring\CommandSucceededEvent::getServiceId — Returns the load balancer service ID for the command
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
