ProfilingSnapshot
API reference › Debug Core › Panel › Profile › ProfilingSnapshot
Canonical profiling snapshot holding the request metrics, the resolved profile blocks, and the memory samples that feed the timeline chart.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$memory readonly constructor | int | Peak memory in bytes recorded for the request. | ProfilingSnapshot |
$time readonly constructor | float | Request processing duration in seconds. | ProfilingSnapshot |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a profiling snapshot from request metrics, blocks, and memory samples. | ProfilingSnapshot |
capture() static | Resolves the logger’s begin/end pairs into typed blocks and collects the per-message memory samples. | ProfilingSnapshot |
captureCompleted() static | Normalizes completed profiler messages carrying token, category, timing, nesting, memory, and trace context. | ProfilingSnapshot |
entries() | Returns the resolved profile blocks. | ProfilingSnapshot |
fromArray() static | Narrows the persisted profiling payload into a typed snapshot. | ProfilingSnapshot |
jsonSerialize() | Returns the panel snapshot for JSON serialization. | ProfilingSnapshot |
samples() | Returns the memory samples that feed the timeline chart. | ProfilingSnapshot |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(int $memory, float $time, list<PHPForge\Debug\Panel\Profile\ProfileRow> $entries, list<PHPForge\Debug\Panel\MemorySample> $samples)Creates a profiling snapshot from request metrics, blocks, and memory samples.
Parameters
| Parameter | Type | Description |
|---|---|---|
$memory | int | |
$time | float | |
$entries | list<ProfileRow> | |
$samples | list<PHPForge\> |
capture()
Section titled “capture() ”public static function capture(int $memory, float $time, list<PHPForge\Debug\Panel\Profile\LogTuple> $messages): selfResolves the logger’s begin/end pairs into typed blocks and collects the per-message memory samples.
Parameters
| Parameter | Type | Description |
|---|---|---|
$memory | int | |
$time | float | |
$messages | list<PHPForge\ | Profile tuples in capture order. |
Returns
self
captureCompleted()
Section titled “captureCompleted() ”public static function captureCompleted(int $memory, float $time, array<int|string, mixed> $messages): selfNormalizes completed profiler messages carrying token, category, timing, nesting, memory, and trace context.
Parameters
| Parameter | Type | Description |
|---|---|---|
$memory | int | |
$time | float | |
$messages | array<int| | Completed profiler messages. |
Returns
self
entries()
Section titled “entries() ”public function entries(): list<PHPForge\Debug\Panel\Profile\ProfileRow>Returns the resolved profile blocks.
Returns
list<ProfileRow>: Resolved profile blocks in capture order.
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfNarrows the persisted profiling payload into a typed snapshot.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Persisted payload, expected to be an object carrying the declared shape. |
$path | string | JSON path of the payload, used to report a malformed capture. |
Returns
self: Snapshot carrying the request metrics, the profile blocks, and the memory samples.
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the panel snapshot for JSON serialization.
Returns
array<string, mixed>
samples()
Section titled “samples() ”public function samples(): list<PHPForge\Debug\Panel\MemorySample>Returns the memory samples that feed the timeline chart.
Returns
list<PHPForge\Debug\Panel\MemorySample>: Memory readings recorded alongside each captured profile message.