UNPKG

@voicenter-team/mysql-dynamic-cluster

Version:

Galera cluster with implementation of dynamic choose mysql server for queries, caching, hashing it and metrics

44 lines (43 loc) 1.28 kB
/** * Created by Bohdan on Sep, 2021 */ import { Pool } from "./Pool"; import { IUserPoolSettings } from "../types/PoolSettingsInterfaces"; export declare class PoolStatus { active: boolean; availableConnectionCount: number; private readonly _pool; private _isValid; get isValid(): boolean; private _queryTime; get queryTime(): number; private _loadScore; get loadScore(): number; private _validator; private _loadFactor; private _timer; private _nextCheckTime; private readonly timerCheckRange; private readonly timerCheckMultiplier; /** * @param pool pool of what status to check * @param settings pool settings * @param active default pool active status before status check * @param availableConnectionCount max connection count in the pool */ constructor(pool: Pool, settings: IUserPoolSettings, active: boolean, availableConnectionCount: number); /** * Stop pool check status timer */ stopTimerCheck(): void; /** * Check pool status */ checkStatus(): Promise<void>; /** * Start timer for next pool check status * @param downgrade downgrade time for next check pool status? * @private */ private nextCheckStatus; }