# The MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent class

(mongodb >=1.13.0)

## 简介

The MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent class encapsulates information about a successful server heartbeat (i.e. » hello command issued through » server monitoring).

## 类摘要

final class MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent {
/* 属性 */
public readonly string $host;
public readonly int $port;
public readonly bool $awaited;
public readonly int $duration;
public readonly object $reply;
/* 方法 */
final public function getDurationMicros(): int
final public function getHost(): string
final public function getPort(): int
final public function getReply(): object
final public function isAwaited(): bool
}

## 属性

host
  The hostname of the server.
port
  The port of the server.
awaited
  Whether the heartbeat used a streaming protocol. The extension does not use the streaming protocol for monitoring, so this method will always return `false`.
duration
  The duration of the heartbeat in microseconds. The duration is a calculated value that includes the time to send the message and receive the response from the server.
reply
  The reply document returned by the server.

## 更新日志

版本 | 说明
--- | ---
PECL mongodb 2.3.0 | Added public readonly properties. The duration property replaces the getDurationMicros() method.

## 目录

- MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getDurationMicros — Returns the heartbeat's duration in microseconds
- MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getHost — Returns the hostname of the server
- MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getPort — Returns the port on which this server is listening
- MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getReply — Returns the heartbeat reply document
- MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::isAwaited — Returns whether the heartbeat used a streaming protocol

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open