Skip to content

Debug - Node Heapsnapshot

Generate a node heapsnapshot for debugging.

Prerequisites

  1. Set WAHA_DEBUG_MODE=True environment variable.
  2. Restart the container.

Usage

The Observability facade's heapSnapshot method may be used to generate a node heapsnapshot.

TIP

Execute this request only when the issue is happening to collect the most recent information.

php
use NjoguAmos\Waha\Facades\Observability;

/** @var \Saloon\Http\Response $heap */
$heap = Observability::heapSnapshot();

Response

The response returned by the heapSnapshot method is an instance of Saloon\Http\Response. You can send the resulting file to the developers or open about://inspect in Chrome to analyze the heap.

php
/** @var \Saloon\Http\Response $heap */

$heap->status(); // 200
$heap->body();   // Binary content of the heapsnapshot

Engines

WEBJSWPPNOWEBGOWS

References

Released under the MIT License.