diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2019-07-08 00:17:24 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2019-07-08 00:22:16 +0200 |
commit | da804fe7202bbb8d841d50024844714bdace4362 (patch) | |
tree | f2b6d57b4edce97df67008a74d572eb433bd014c | |
parent | e06affae179dfeb41f77d8ad2ea81fa3f2fa439d (diff) |
Metrics: Added scrape memory usage
-rw-r--r-- | src/Controllers/Metrics/Controller.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Controllers/Metrics/Controller.php b/src/Controllers/Metrics/Controller.php index e0824c05..f6ea3967 100644 --- a/src/Controllers/Metrics/Controller.php +++ b/src/Controllers/Metrics/Controller.php @@ -135,6 +135,12 @@ class Controller extends BaseController microtime(true) - $this->request->server->get('REQUEST_TIME_FLOAT', $now), ]; + $data['scrape_memory_bytes'] = [ + 'type' => 'gauge', + 'help' => 'Memory usage of the current request', + memory_get_usage(false), + ]; + return $this->response ->withHeader('Content-Type', 'text/plain; version=0.0.4') ->withContent($this->engine->get('/metrics', $data)); |