HistoryMetricComparison
API reference › Yii3 Debug › Comparison › HistoryMetricComparison
Immutable presentation data for one request-summary metric in a capture comparison.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$label readonly constructor | string | Human-readable metric name. | HistoryMetricComparison |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
baseline() | Returns the formatted value of the baseline capture. | HistoryMetricComparison |
create() static | Creates a metric that can be fluently linked with withPanelId(). | HistoryMetricComparison |
delta() | Returns the formatted difference between both captures. | HistoryMetricComparison |
panelId() | Returns the panel this metric deep-links to. | HistoryMetricComparison |
target() | Returns the formatted value of the target capture. | HistoryMetricComparison |
trend() | Returns the direction the metric moved in. | HistoryMetricComparison |
withPanelId() | Returns a copy deep-linking the metric to a panel. | HistoryMetricComparison |
Method details
Section titled “Method details”baseline()
Section titled “baseline() ”public function baseline(): stringReturns the formatted value of the baseline capture.
Returns
string: Formatted baseline value.
create()
Section titled “create() ”public static function create(string $label, Yii3\Debug\Comparison\HistoryMetricValues $values): selfCreates a metric that can be fluently linked with withPanelId().
Parameters
| Parameter | Type | Description |
|---|---|---|
$label | string | Human-readable metric name. |
$values | HistoryMetricValues | Formatted values and outcome of the metric. |
Returns
self: Metric without a panel link.
delta()
Section titled “delta() ”public function delta(): stringReturns the formatted difference between both captures.
Returns
string: Formatted difference from baseline to target.
panelId()
Section titled “panelId() ”public function panelId(): string|nullReturns the panel this metric deep-links to.
Returns
string|null: Panel the metric deep-links to, or null when it links nowhere.
target()
Section titled “target() ”public function target(): stringReturns the formatted value of the target capture.
Returns
string: Formatted target value.
trend()
Section titled “trend() ”public function trend(): stringReturns the direction the metric moved in.
Returns
string: Directional CSS vocabulary: 'up', 'down', or 'neutral'.
withPanelId()
Section titled “withPanelId() ”public function withPanelId(string|null $panelId): selfReturns a copy deep-linking the metric to a panel.
Parameters
| Parameter | Type | Description |
|---|---|---|
$panelId | string| | Panel to link to, or null to drop the link. |
Returns
self: Metric with the link applied.