23 lines
458 B
PHP
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;
|
|
}
|
|
}
|