diff options
author | msquare <msquare@notrademark.de> | 2019-07-21 13:32:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-21 13:32:45 +0200 |
commit | d4d4b409b6fd96ca297af323936b8922d45b6eda (patch) | |
tree | 6c8efa1a1e429f3965820838796cb4b97cd2df11 /src/Controllers/Metrics/MetricsEngine.php | |
parent | d5bf7fd065a5ea93dea9fd55e6ac225ee062a3db (diff) | |
parent | 51a3c6eb44a5dbdf9d7a3cfac678f0d29b0d3eef (diff) |
Merge pull request #622 from MyIgel/controllers
AuthController (login, logout), use templating, replaced gettext, input validation
Diffstat (limited to 'src/Controllers/Metrics/MetricsEngine.php')
-rw-r--r-- | src/Controllers/Metrics/MetricsEngine.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/Controllers/Metrics/MetricsEngine.php b/src/Controllers/Metrics/MetricsEngine.php index 1e0f6957..21ae8fd0 100644 --- a/src/Controllers/Metrics/MetricsEngine.php +++ b/src/Controllers/Metrics/MetricsEngine.php @@ -9,13 +9,13 @@ class MetricsEngine implements EngineInterface /** * Render metrics * - * @example $data = ['foo' => [['labels' => ['foo'=>'bar'], 'value'=>42]], 'bar'=>123] - * * @param string $path * @param mixed[] $data * @return string + * + * @example $data = ['foo' => [['labels' => ['foo'=>'bar'], 'value'=>42]], 'bar'=>123] */ - public function get($path, $data = []): string + public function get(string $path, array $data = []): string { $return = []; foreach ($data as $name => $list) { @@ -52,7 +52,7 @@ class MetricsEngine implements EngineInterface * @param string $path * @return bool */ - public function canRender($path): bool + public function canRender(string $path): bool { return $path == '/metrics'; } @@ -60,8 +60,8 @@ class MetricsEngine implements EngineInterface /** * @param string $name * @param array|mixed $row - * @see https://prometheus.io/docs/instrumenting/exposition_formats/ * @return string + * @see https://prometheus.io/docs/instrumenting/exposition_formats/ */ protected function formatData($name, $row): string { @@ -135,4 +135,12 @@ class MetricsEngine implements EngineInterface $value ); } + + /** + * Does nothing as shared data will onyly result in unexpected behaviour + * + * @param string|mixed[] $key + * @param mixed $value + */ + public function share($key, $value = null) { } } |