import type { Document, ObjectId } from '../bson'; import { WriteProtocolMessageType } from './commands'; import type { Connection } from './connection'; /** * An event indicating the start of a given * @public * @category Event */ export declare class CommandStartedEvent { commandObj?: Document; requestId: number; databaseName: string; commandName: string; command: Document; address: string; connectionId?: string | number; serviceId?: ObjectId; /** * Create a started event * * @internal * @param pool - the pool that originated the command * @param command - the command */ constructor(connection: Connection, command: WriteProtocolMessageType); get hasServiceId(): boolean; } /** * An event indicating the success of a given command * @public * @category Event */ export declare class CommandSucceededEvent { address: string; connectionId?: string | number; requestId: number; duration: number; commandName: string; reply: unknown; serviceId?: ObjectId; /** * Create a succeeded event * * @internal * @param pool - the pool that originated the command * @param command - the command * @param reply - the reply for this command from the server * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration */ constructor(connection: Connection, command: WriteProtocolMessageType, reply: Document | undefined, started: number); get hasServiceId(): boolean; } /** * An event indicating the failure of a given command * @public * @category Event */ export declare class CommandFailedEvent { address: string; connectionId?: string | number; requestId: number; duration: number; commandName: string; failure: Error; serviceId?: ObjectId; /** * Create a failure event * * @internal * @param pool - the pool that originated the command * @param command - the command * @param error - the generated error or a server error response * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration */ constructor(connection: Connection, command: WriteProtocolMessageType, error: Error | Document, started: number); get hasServiceId(): boolean; } //# sourceMappingURL=command_monitoring_events.d.ts.map