Skip to content

getDebugState

const getDebugState: any = addon.getDebugState

Defined in: index.cts:576

Retrieves debug state information about the internal WarpSocket data structures.

mode

The type of data to retrieve: “channels” for channel subscriptions, “sockets” for socket details, “workers” for worker thread info, “kv” for key-value store entries.

singleKey

Optional. When provided, returns only the data for a specific item: for “channels”, a channel name (bytes) or socket ID (number); for “sockets” and “workers”, a socket ID or worker ID (number); for “kv”, a key (bytes).

For “channels” and “kv”, an array of objects with detailed state information, capped at 2000 entries. For “sockets” and “workers”, an object keyed by socketId/workerId with values being the debug info objects. When singleKey is provided, a single object or undefined is returned instead of an array/object (except when mode is “channels” and singleKey is a number).