Skip to content
PHP Ecosystem
Explore

TimelineRenderer

API reference › Debug Core › Panel › Timeline › TimelineRenderer

final classPHPForge\Debug\Panel\Timeline\TimelineRenderer
Sourcesrc/Panel/Timeline/TimelineRenderer.php

Renders the shared Timeline summary, filters, empty hint, and positioned span chart.

MethodDescriptionDefined by
renderChart() staticRenders the complete timeline chart from prepared spans and ruler offsets.TimelineRenderer
renderEmptyHint() staticRenders the empty-state hint linking to the sortable Profiling panel.TimelineRenderer
renderFilterForm() staticRenders the filter form while preserving adapter-owned route parameters.TimelineRenderer
renderSummary() staticRenders total duration, peak memory, and visible span count.TimelineRenderer
public static function renderChart(list<PHPForge\Debug\Panel\Timeline\TimelineSpanRow> $rows, array<int, float> $rulers, string $memorySvg = '', int $memory = 0, int $memoryHeight = 40): string

Renders the complete timeline chart from prepared spans and ruler offsets.

Parameters

ParameterTypeDescription
$rowslist<TimelineSpanRow>Positioned timeline spans.
$rulersarray<int, float>Ruler offsets keyed by milliseconds.
$memorySvgstringInline memory graph markup, or an empty string to omit the footer.
$memoryintPeak memory reported in the footer, in bytes.
$memoryHeightintMemory graph track height, in pixels.

Returns

string: Chart markup, or an empty string when no span survived filtering.

public static function renderEmptyHint(bool $hasRows, string $profilingUrl): string

Renders the empty-state hint linking to the sortable Profiling panel.

Parameters

ParameterTypeDescription
$hasRowsboolWhether any span survived filtering.
$profilingUrlstringURL of the Profiling panel for the same request.

Returns

string: Hint markup, or an empty string when spans are present.

public static function renderFilterForm(string $action, array<string, string> $hiddenParams, string $duration, string $category): string

Renders the filter form while preserving adapter-owned route parameters.

Parameters

ParameterTypeDescription
$actionstringForm action URL owned by the adapter.
$hiddenParamsarray<string, string>Hidden route and theme parameters.
$durationstringMinimum duration filter, in milliseconds.
$categorystringCategory filter matched against span names.

Returns

string: Filter form markup.

public static function renderSummary(float $duration, int $memory, int $spanCount): string

Renders total duration, peak memory, and visible span count.

Parameters

ParameterTypeDescription
$durationfloatTotal request duration, in milliseconds.
$memoryintPeak memory, in bytes.
$spanCountintNumber of spans left after filtering.

Returns

string: Summary header markup.