const DEBUG_ENABLED = process.env.DEBUG?.split(',').includes('accounter:test');
export const debugLog = (...args) => {
    if (DEBUG_ENABLED)
        console.debug('[test-db]', ...args);
};
export function isPoolHealthy(pool) {
    return {
        total: pool.totalCount,
        idle: pool.idleCount,
        waiting: pool.waitingCount,
    };
}
export function emitMetrics(label, pool) {
    if (!DEBUG_ENABLED)
        return;
    const metrics = pool ? isPoolHealthy(pool) : undefined;
    if (metrics) {
        console.debug('[test-db][metrics]', label, metrics);
    }
    else {
        console.debug('[test-db][metrics]', label);
    }
}
export { DEBUG_ENABLED };
//# sourceMappingURL=diagnostics.js.map