Skip to main content

poolChannels

import { poolChannels } from 'postgrejs';

Plain node:diagnostics_channel channels on which a Pool reports what it does, since 3.15.0, for metrics on how full a pool is and how long its connections are held. Each value is a Node Channel; the same channel is also reachable by name with diagnosticsChannel.channel('postgrejs:pool:checkout') and so on. Nothing is published while a channel has no subscribers.

See Pool channels in the Tracing Channels guide for usage.

KeyChannel namePublished whenMessage
createpostgrejs:pool:createa pool is constructedPoolEventMessage
closepostgrejs:pool:closea pool has closedPoolEventMessage
checkoutpostgrejs:pool:checkouta pooled connection is handed out, by acquire() or to a pipelined pool.query()PoolCheckoutMessage
checkinpostgrejs:pool:checkina pooled connection comes backPoolCheckoutMessage
timeoutpostgrejs:pool:timeouta caller gave up waiting, after acquireTimeoutMillisPoolEventMessage

PoolEventMessage​

KeyTypeDescription
poolPoolThe pool

PoolCheckoutMessage​

KeyTypeDescription
poolPoolThe pool
resourceobjectAn opaque object standing for the pooled connection, the same one in a checkout and the checkin that ends it. It is not a Connection