import { Gauge, Counter, Histogram } from 'prom-client'; import { ExtendedGaugeInternal } from 'prometheus-extended-gauge'; import { Pool, Factory } from 'generic-pool'; /** * Sensible defaults for the connection pool options */ export declare const DEFAULT_CONNECTION_POOL_OPTIONS: PoolConfig; /** * Base interface for the configuration information needed to create a new connection */ export interface ConnectionConfig { user: string; } /** * Class for the config of a Pool. * This class is not supposed to be extended, as the framework does not expose methods to override the creation of the * connection pools. */ export interface PoolConfig { max?: number; min?: number; maxWaitingClients?: number; testOnBorrow?: boolean; acquireTimeoutMillis?: number; evictionRunIntervalMillis?: number; numTestsPerRun?: number; softIdleTimeoutMillis?: number; idleTimeoutMillis?: number; connectionConfig?: C; } export declare abstract class ConnectionPool { abstract getName(): string; abstract isReadonly(): boolean; abstract getConnection(): Promise; abstract release(connection: T): any; abstract start(): Promise; abstract stop(): Promise; } export declare class InstrumentedFactory implements Factory { validateFailedCounter: Counter.Internal; connectErrorsCounter: Counter.Internal; connectTimeHistogram: Histogram.Internal; totalGauge: Gauge.Internal; factory: Factory; constructor(factory: Factory, name: string, readonly: boolean); create(): Promise; destroy(client: T): Promise; validate(client: T): Promise; } export declare class InstrumentedConnectionPool extends ConnectionPool { readonly: boolean; name: string; activeGauge: ExtendedGaugeInternal; useTimeHistogram: Histogram.Internal; acquireErrorsCounter: Counter.Internal; pool: Pool; acquireTimeHistogram: Histogram.Internal; options: PoolConfig; private status; maxConnectionLimitGauge: Gauge.Internal; constructor(factory: Factory, options: PoolConfig, name: string, readonly: boolean); getName(): string; isReadonly(): boolean; getConnection(): Promise; private getGenericPoolOptions; release(connection: C): void; start(): Promise; stop(): Promise; getOptions(): PoolConfig; }