yxorP Documentation

EventCollector
in package
implements CommandSubscriber

EventCollector handles "storeEventsAsEntities" for client entities.

Unlike EventObserver, this does not support ignoring command monitoring events for specific commands. That said, internal/security commands that bypass command monitoring will still be ignored.

Interfaces, Classes, Traits and Enums

CommandSubscriber

Table of Contents

$clientId  : string
$collectEvents  : array<string|int, mixed>
$context  : Context
$eventList  : BSONArray
$supportedEvents  : array<string|int, mixed>
__construct()  : mixed
commandFailed()  : void
commandStarted()  : void
commandSucceeded()  : void
start()  : void
stop()  : void
getConnectionId()  : string
getEventName()  : string
handleCommandMonitoringEvent()  : void

Properties

$collectEvents

private array<string|int, mixed> $collectEvents = []

$supportedEvents

private static array<string|int, mixed> $supportedEvents = ['PoolCreatedEvent' => null, 'PoolReadyEvent' => null, 'PoolClearedEvent' => null, 'PoolClosedEvent' => null, 'ConnectionCreatedEvent' => null, 'ConnectionReadyEvent' => null, 'ConnectionClosedEvent' => null, 'ConnectionCheckOutStartedEvent' => null, 'ConnectionCheckOutFailedEvent' => null, 'ConnectionCheckedOutEvent' => null, 'ConnectionCheckedInEvent' => null, 'CommandStartedEvent' => \MongoDB\Driver\Monitoring\CommandStartedEvent::class, 'CommandSucceededEvent' => \MongoDB\Driver\Monitoring\CommandSucceededEvent::class, 'CommandFailedEvent' => \MongoDB\Driver\Monitoring\CommandFailedEvent::class]

Methods

__construct()

public __construct(BSONArray $eventList, array<string|int, mixed> $collectEvents, string $clientId, Context $context) : mixed
Parameters
$eventList : BSONArray
$collectEvents : array<string|int, mixed>
$clientId : string
$context : Context
Return values
mixed

getConnectionId()

private static getConnectionId(CommandStartedEvent|CommandSucceededEvent|CommandFailedEvent $event) : string
Parameters
$event : CommandStartedEvent|CommandSucceededEvent|CommandFailedEvent
Return values
string

getEventName()

private static getEventName(object $event) : string
Parameters
$event : object
Return values
string

handleCommandMonitoringEvent()

private handleCommandMonitoringEvent(CommandStartedEvent|CommandSucceededEvent|CommandFailedEvent $event) : void
Parameters
$event : CommandStartedEvent|CommandSucceededEvent|CommandFailedEvent
Return values
void

Search results