Files
kupshop/bundles/KupShop/KupShopBundle/Metrics/StatusSample.php
2025-08-02 16:30:27 +02:00

32 lines
808 B
PHP

<?php
declare(strict_types=1);
namespace KupShop\KupShopBundle\Metrics;
class StatusSample
{
protected string $type;
protected array $labelNames = ['type'];
protected array $labelValues = [];
protected mixed $value;
public function __construct(string $type, mixed $value, array $labelNames = [], array $labelValues = [])
{
$this->type = $type;
$this->value = $value;
$this->labelNames = array_merge($this->labelNames, $labelNames);
$this->labelValues = array_merge([$type], $labelValues);
}
public function toArray(): array
{
return [
'name' => 'kupshop_status',
'labelNames' => $this->labelNames,
'labelValues' => $this->labelValues,
'value' => $this->value,
];
}
}