Loading prometheus_metrics.info.yml +4 −5 Original line number Diff line number Diff line name: 'Prometheus Metrics' type: module description: 'Provide metrics to Prometheus service' core: 8.x core_version_requirement: ^8 || ^9 core_version_requirement: ^8 || ^9 || ^10 package: 'Statistics' configure: prometheus_metrics.configuration_form # Information added by Drupal.org packaging script on 2021-09-16 version: '1.0.0-alpha9' # Information added by Drupal.org packaging script on 2021-09-17 version: '1.0.0-alpha11' project: 'prometheus_metrics' datestamp: 1631814635 datestamp: 1631872718 src/EventSubscriber/PrometheusRequestSubscriber.php +6 −6 Original line number Diff line number Diff line Loading @@ -2,6 +2,8 @@ namespace Drupal\prometheus_metrics\EventSubscriber; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\Event\TerminateEvent; use Psr\Log\LoggerInterface; use Drupal\Component\Utility\Timer; use Drupal\Core\Config\ConfigFactoryInterface; Loading @@ -10,8 +12,6 @@ use Drupal\prometheus_metrics\Bridge\PrometheusMetricsInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\PostResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; /** Loading Loading @@ -101,10 +101,10 @@ class PrometheusRequestSubscriber implements EventSubscriberInterface { /** * Start timer for the request. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The start of request event. */ public function onRequest(GetResponseEvent $event) { public function onRequest(RequestEvent $event) { Timer::start(PrometheusDefaults::TIMER_NAME); } Loading Loading @@ -132,10 +132,10 @@ class PrometheusRequestSubscriber implements EventSubscriberInterface { * Stores a histogram timer and counter for the request * by method, route and status. * * @param \Symfony\Component\HttpKernel\Event\PostResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\TerminateEvent $event * The event. */ public function onTerminate(PostResponseEvent $event) { public function onTerminate(TerminateEvent $event) { if (PHP_SAPI === "cli") { // In CLI context there is no request to trace return; Loading src/Events/EntityCRUDEvent.php +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ namespace Drupal\prometheus_metrics\Events; use Drupal\Core\Entity\EntityInterface; use Symfony\Component\EventDispatcher\Event; use Symfony\Contracts\EventDispatcher\Event; /** * Stores details about the event. Loading tests/Controller/MetricsControllerTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class MetricsControllerTest extends BrowserTestBase { /** * {@inheritdoc} */ public function setUp() { public function setUp(): void { parent::setUp(); } Loading tests/src/Functional/LoadTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class LoadTest extends BrowserTestBase { /** * {@inheritdoc} */ protected function setUp() { protected function setUp(): void { parent::setUp(); $this->user = $this->drupalCreateUser(['administer site configuration']); $this->drupalLogin($this->user); Loading Loading
prometheus_metrics.info.yml +4 −5 Original line number Diff line number Diff line name: 'Prometheus Metrics' type: module description: 'Provide metrics to Prometheus service' core: 8.x core_version_requirement: ^8 || ^9 core_version_requirement: ^8 || ^9 || ^10 package: 'Statistics' configure: prometheus_metrics.configuration_form # Information added by Drupal.org packaging script on 2021-09-16 version: '1.0.0-alpha9' # Information added by Drupal.org packaging script on 2021-09-17 version: '1.0.0-alpha11' project: 'prometheus_metrics' datestamp: 1631814635 datestamp: 1631872718
src/EventSubscriber/PrometheusRequestSubscriber.php +6 −6 Original line number Diff line number Diff line Loading @@ -2,6 +2,8 @@ namespace Drupal\prometheus_metrics\EventSubscriber; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\Event\TerminateEvent; use Psr\Log\LoggerInterface; use Drupal\Component\Utility\Timer; use Drupal\Core\Config\ConfigFactoryInterface; Loading @@ -10,8 +12,6 @@ use Drupal\prometheus_metrics\Bridge\PrometheusMetricsInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\PostResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; /** Loading Loading @@ -101,10 +101,10 @@ class PrometheusRequestSubscriber implements EventSubscriberInterface { /** * Start timer for the request. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The start of request event. */ public function onRequest(GetResponseEvent $event) { public function onRequest(RequestEvent $event) { Timer::start(PrometheusDefaults::TIMER_NAME); } Loading Loading @@ -132,10 +132,10 @@ class PrometheusRequestSubscriber implements EventSubscriberInterface { * Stores a histogram timer and counter for the request * by method, route and status. * * @param \Symfony\Component\HttpKernel\Event\PostResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\TerminateEvent $event * The event. */ public function onTerminate(PostResponseEvent $event) { public function onTerminate(TerminateEvent $event) { if (PHP_SAPI === "cli") { // In CLI context there is no request to trace return; Loading
src/Events/EntityCRUDEvent.php +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ namespace Drupal\prometheus_metrics\Events; use Drupal\Core\Entity\EntityInterface; use Symfony\Component\EventDispatcher\Event; use Symfony\Contracts\EventDispatcher\Event; /** * Stores details about the event. Loading
tests/Controller/MetricsControllerTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class MetricsControllerTest extends BrowserTestBase { /** * {@inheritdoc} */ public function setUp() { public function setUp(): void { parent::setUp(); } Loading
tests/src/Functional/LoadTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class LoadTest extends BrowserTestBase { /** * {@inheritdoc} */ protected function setUp() { protected function setUp(): void { parent::setUp(); $this->user = $this->drupalCreateUser(['administer site configuration']); $this->drupalLogin($this->user); Loading