ProfileRow
API reference › Debug Core › Panel › Profile › ProfileRow
Typed profile block derived once from the Yii logger timings and persisted in that form.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$category readonly constructor | string | Profile category attached to the Yii::beginProfile() token. | ProfileRow |
$duration readonly constructor | float | Block execution time in milliseconds. | ProfileRow |
$info readonly constructor | string | Profile token / informational label captured at Yii::beginProfile(). | ProfileRow |
$level readonly constructor | int | Nesting level of the block, used to render an indentation arrow per level. | ProfileRow |
$memory readonly constructor | int | Peak memory in bytes recorded when the block closed. | ProfileRow |
$memoryDiff readonly constructor | int | Memory delta in bytes between the block’s begin and end markers. | ProfileRow |
$seq readonly constructor | int | Zero-based sequence index assigned in capture order. | ProfileRow |
$timestamp readonly constructor | float | Capture timestamp in milliseconds since the Unix epoch. | ProfileRow |
$trace readonly constructor | list<array<string, | Backtrace frames captured at the Yii::beginProfile() call site. | ProfileRow |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a profile row from captured timing data. | ProfileRow |
fromArray() static | Narrows one persisted block of the profiling payload into a typed row. | ProfileRow |
fromTiming() static | Converts one timing returned by ProfileTimings::calculate() into a typed row. | ProfileRow |
jsonSerialize() | Returns the typed row for JSON serialization. | ProfileRow |
maxDuration() static | Returns the longest block duration in milliseconds, or 0.0 when there are no rows. | ProfileRow |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(float $timestamp, float $duration, string $category, string $info, int $level, int $seq, int $memory, int $memoryDiff, array $trace)Creates a profile row from captured timing data.
Parameters
| Parameter | Type | Description |
|---|---|---|
$timestamp | float | |
$duration | float | |
$category | string | |
$info | string | |
$level | int | |
$seq | int | |
$memory | int | |
$memoryDiff | int | |
$trace | array |
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfNarrows one persisted block of the profiling payload into a typed row.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Persisted block, expected to be an object carrying the declared shape. |
$path | string | JSON path of the block, used to report a malformed payload. |
Returns
self: Row carrying every persisted block field.
fromTiming()
Section titled “fromTiming() ”public static function fromTiming(PHPForge\Debug\Panel\Profile\ProfileTiming $timing, int $seq): selfConverts one timing returned by ProfileTimings::calculate() into a typed row.
Parameters
| Parameter | Type | Description |
|---|---|---|
$timing | PHPForge\ | Profile timing entry. |
$seq | int | Zero-based sequence index to assign. |
Returns
self
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the typed row for JSON serialization.
Returns
array<string, mixed>
maxDuration()
Section titled “maxDuration() ”public static function maxDuration(list<self> $rows): floatReturns the longest block duration in milliseconds, or 0.0 when there are no rows.
Parameters
| Parameter | Type | Description |
|---|---|---|
$rows | list<self> | Captured profile rows. |
Returns
float