UNPKG

@voicenter-team/mysql-dynamic-cluster

Version:

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

34 lines (33 loc) 755 B
import { IMetric, IMetricOptions } from "../types/MetricsInterfaces"; export declare class QueryTimer { private _timeStart; private _timeEnd; private _queryTime; private readonly _metric; /** * @param metric metric object where to save query time */ constructor(metric: IMetric); /** * Start counting query time */ start(): void; /** * Stop counting query time */ end(): void; /** * Set query time to Metric * @param options extra options for metric like pool name or service name */ save(options?: IMetricOptions): void; /** * Get query time */ get(): number; /** * Get time now * @private */ private static _getTime; }