Commit 073f18af authored by git's avatar git Committed by Lee Hanson
Browse files

Issue #3289167 by Project Update Bot, deranga: Automated Drupal 10 compatibility fixes

parent 5593405f
Loading
Loading
Loading
Loading
+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
+6 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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;

/**
@@ -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);
  }

@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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.
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ class MetricsControllerTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  public function setUp() {
  public function setUp(): void {
    parent::setUp();
  }

+1 −1
Original line number Diff line number Diff line
@@ -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);