Skip to content
PHP Ecosystem
Explore

ProfileRow

API reference › Debug Core › Panel › Profile › ProfileRow

final readonly classPHPForge\Debug\Panel\Profile\ProfileRow
ImplementsPHPForge\Debug\Storage\PanelRow
Sourcesrc/Panel/Profile/ProfileRow.php

Typed profile block derived once from the Yii logger timings and persisted in that form.

PropertyTypeDescriptionDefined by
$category readonly constructorstringProfile category attached to the Yii::beginProfile() token.ProfileRow
$duration readonly constructorfloatBlock execution time in milliseconds.ProfileRow
$info readonly constructorstringProfile token / informational label captured at Yii::beginProfile().ProfileRow
$level readonly constructorintNesting level of the block, used to render an indentation arrow per level.ProfileRow
$memory readonly constructorintPeak memory in bytes recorded when the block closed.ProfileRow
$memoryDiff readonly constructorintMemory delta in bytes between the block’s begin and end markers.ProfileRow
$seq readonly constructorintZero-based sequence index assigned in capture order.ProfileRow
$timestamp readonly constructorfloatCapture timestamp in milliseconds since the Unix epoch.ProfileRow
$trace readonly constructorlist<array<string, mixed>>Backtrace frames captured at the Yii::beginProfile() call site.ProfileRow
MethodDescriptionDefined by
__construct()Creates a profile row from captured timing data.ProfileRow
fromArray() staticNarrows one persisted block of the profiling payload into a typed row.ProfileRow
fromTiming() staticConverts one timing returned by ProfileTimings::calculate() into a typed row.ProfileRow
jsonSerialize()Returns the typed row for JSON serialization.ProfileRow
maxDuration() staticReturns the longest block duration in milliseconds, or 0.0 when there are no rows.ProfileRow
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

ParameterTypeDescription
$timestampfloat
$durationfloat
$categorystring
$infostring
$levelint
$seqint
$memoryint
$memoryDiffint
$tracearray
public static function fromArray(mixed $data, string $path): self

Narrows one persisted block of the profiling payload into a typed row.

Parameters

ParameterTypeDescription
$datamixedPersisted block, expected to be an object carrying the declared shape.
$pathstringJSON path of the block, used to report a malformed payload.

Returns

self: Row carrying every persisted block field.

public static function fromTiming(PHPForge\Debug\Panel\Profile\ProfileTiming $timing, int $seq): self

Converts one timing returned by ProfileTimings::calculate() into a typed row.

Parameters

ParameterTypeDescription
$timingPHPForge\Debug\Panel\Profile\ProfileTimingProfile timing entry.
$seqintZero-based sequence index to assign.

Returns

self

public function jsonSerialize(): array<string, mixed>

Returns the typed row for JSON serialization.

Returns

array<string, mixed>

public static function maxDuration(list<self> $rows): float

Returns the longest block duration in milliseconds, or 0.0 when there are no rows.

Parameters

ParameterTypeDescription
$rowslist<self>Captured profile rows.

Returns

float