forked from CodelyTV/php-ddd-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b34597
commit 7fe7376
Showing
16 changed files
with
853 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
metrics_get: | ||
path: /metrics | ||
controller: CodelyTv\Apps\Backoffice\Backend\Controller\Metrics\MetricsController | ||
methods: [GET] |
28 changes: 28 additions & 0 deletions
28
apps/backoffice/backend/src/Controller/Metrics/MetricsController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CodelyTv\Apps\Backoffice\Backend\Controller\Metrics; | ||
|
||
use CodelyTv\Shared\Infrastructure\Monitoring\PrometheusMonitor; | ||
use Prometheus\RenderTextFormat; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
final class MetricsController | ||
{ | ||
private PrometheusMonitor $monitor; | ||
|
||
public function __construct(PrometheusMonitor $monitor) | ||
{ | ||
$this->monitor = $monitor; | ||
} | ||
|
||
public function __invoke(Request $request): Response | ||
{ | ||
$renderer = new RenderTextFormat(); | ||
$result = $renderer->render($this->monitor->registry()->getMetricFamilySamples()); | ||
|
||
return new Response($result, 200, ['Content-Type' => RenderTextFormat::MIME_TYPE]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
metrics_get: | ||
path: /metrics | ||
controller: CodelyTv\Apps\Backoffice\Frontend\Controller\Metrics\MetricsController | ||
methods: [GET] |
28 changes: 28 additions & 0 deletions
28
apps/backoffice/frontend/src/Controller/Metrics/MetricsController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CodelyTv\Apps\Backoffice\Frontend\Controller\Metrics; | ||
|
||
use CodelyTv\Shared\Infrastructure\Monitoring\PrometheusMonitor; | ||
use Prometheus\RenderTextFormat; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
final class MetricsController | ||
{ | ||
private PrometheusMonitor $monitor; | ||
|
||
public function __construct(PrometheusMonitor $monitor) | ||
{ | ||
$this->monitor = $monitor; | ||
} | ||
|
||
public function __invoke(Request $request): Response | ||
{ | ||
$renderer = new RenderTextFormat(); | ||
$result = $renderer->render($this->monitor->registry()->getMetricFamilySamples()); | ||
|
||
return new Response($result, 200, ['Content-Type' => RenderTextFormat::MIME_TYPE]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
metrics_get: | ||
path: /metrics | ||
controller: CodelyTv\Apps\Mooc\Backend\Controller\Metrics\MetricsController | ||
methods: [GET] |
28 changes: 28 additions & 0 deletions
28
apps/mooc/backend/src/Controller/Metrics/MetricsController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CodelyTv\Apps\Mooc\Backend\Controller\Metrics; | ||
|
||
use CodelyTv\Shared\Infrastructure\Monitoring\PrometheusMonitor; | ||
use Prometheus\RenderTextFormat; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
final class MetricsController | ||
{ | ||
private PrometheusMonitor $monitor; | ||
|
||
public function __construct(PrometheusMonitor $monitor) | ||
{ | ||
$this->monitor = $monitor; | ||
} | ||
|
||
public function __invoke(Request $request): Response | ||
{ | ||
$renderer = new RenderTextFormat(); | ||
$result = $renderer->render($this->monitor->registry()->getMetricFamilySamples()); | ||
|
||
return new Response($result, 200, ['Content-Type' => RenderTextFormat::MIME_TYPE]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.