SummaryMetricComparison
API reference › Debug Core › Comparison › SummaryMetricComparison
Calculates and formats request-summary metrics without depending on adapter presentation models.
Results retain the history labels, order, units, trends, and related panel IDs used by both adapters.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$baseline readonly constructor | string | Formatted baseline value. | SummaryMetricComparison |
$delta readonly constructor | string | Formatted difference, or No change when both values match. | SummaryMetricComparison |
$label readonly constructor | string | History metric label. | SummaryMetricComparison |
$panelId readonly constructor | string| | Related panel ID, or null when the metric has no panel. Default: null. | SummaryMetricComparison |
$target readonly constructor | string | Formatted target value. | SummaryMetricComparison |
$trend readonly constructor | string | Trend direction: up, down, or neutral. | SummaryMetricComparison |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
between() static | Compares summaries in the canonical history metric order. | SummaryMetricComparison |
hasDifference() | Returns whether the metric changed between the baseline and the target. | SummaryMetricComparison |
Method details
Section titled “Method details”between()
Section titled “between() ”public static function between(PHPForge\Debug\Storage\RequestSummary $baseline, PHPForge\Debug\Storage\RequestSummary $target): list<self>Compares summaries in the canonical history metric order.
Parameters
| Parameter | Type | Description |
|---|---|---|
$baseline | PHPForge\ | Baseline request metadata. |
$target | PHPForge\ | Target request metadata. |
Returns
list<self>: Metric comparisons in canonical history order.
hasDifference()
Section titled “hasDifference() ”public function hasDifference(): boolReturns whether the metric changed between the baseline and the target.
Returns
bool: true when the formatted delta reports a change; false otherwise.