From e3026321963a47c436911a7f2772aab52235b26a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 9 Nov 2015 18:31:26 +0100 Subject: [PATCH] RestApiClient: use Benchmark --- library/Director/Core/RestApiClient.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/Director/Core/RestApiClient.php b/library/Director/Core/RestApiClient.php index 1e689a63..1961188b 100644 --- a/library/Director/Core/RestApiClient.php +++ b/library/Director/Core/RestApiClient.php @@ -2,6 +2,7 @@ namespace Icinga\Module\Director\Core; +use Icinga\Application\Benchmark; use Exception; class RestApiClient @@ -78,10 +79,12 @@ class RestApiClient ); $context = stream_context_create($opts); + Benchmark::measure('Rest Api, sending ' . $url); $res = file_get_contents($this->url($url), false, $context); if (substr(array_shift($http_response_header), 0, 10) !== 'HTTP/1.1 2') { throw new Exception($res); } + Benchmark::measure('Rest Api, got response'); if ($raw) { return $res; } else {