Files
kupshop/bundles/KupShop/MetricsBundle/PrometheusRegistryAccessor.php
2025-08-02 16:30:27 +02:00

23 lines
458 B
PHP

<?php
namespace KupShop\MetricsBundle;
use Prometheus\CollectorRegistry;
use Prometheus\Storage\APC;
class PrometheusRegistryAccessor
{
/** @var CollectorRegistry */
private $registry;
public function getRegistry(): CollectorRegistry
{
if (isset($this->registry)) {
return $this->registry;
}
$registry = new CollectorRegistry($adapter = new APC());
return $this->registry = $registry;
}
}