The MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent class

- « MongoDB\Driver\Monitoring\ServerOpeningEvent::getTopologyId

- MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getDurationMicros »

- PHP Manual
- MongoDB\Driver\Monitoring
- The MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent class

# The MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent class

(mongodb >=1.13.0)

## Introduction

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

## Class synopsis

final class MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent {
/* Methods */
final public getDurationMicros(): int
final public getError(): Exception
final public getHost(): string
final public getPort(): int
final public isAwaited(): bool
}

## Table of Contents

- MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getDurationMicros — Returns the heartbeat's duration in microseconds
- MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getError — Returns the Exception associated with the failed heartbeat
- MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getHost — Returns the hostname of the server
- MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getPort — Returns the port on which this server is listening
- MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::isAwaited — Returns whether the heartbeat used a streaming protocol