From 5138501dc196240a14a33b3d4b37a02207bf4ad8 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 19 Jan 2016 16:45:20 +0100 Subject: [PATCH] IcingaConfig: use Benchmark --- library/Director/IcingaConfig/IcingaConfig.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php index cd4f561d..476b8774 100644 --- a/library/Director/IcingaConfig/IcingaConfig.php +++ b/library/Director/IcingaConfig/IcingaConfig.php @@ -8,6 +8,7 @@ use Icinga\Module\Director\Util; use Icinga\Module\Director\Objects\IcingaHost; use Icinga\Module\Director\Objects\IcingaZone; use Icinga\Module\Director\Objects\IcingaEndpoint; +use Icinga\Application\Benchmark; use Icinga\Web\Hook; use Exception; @@ -386,12 +387,14 @@ throw $e; protected function createFileFromDb($type) { $class = 'Icinga\\Module\\Director\\Objects\\Icinga' . ucfirst($type); + Benchmark::measure(sprintf('Prefetching %s', $type)); $objects = $class::prefetchAll($this->connection); return $this->createFileForObjects($type, $objects); } protected function createFileForObjects($type, $objects) { + Benchmark::measure(sprintf('Generating %d %s', count($objects), $type)); if (empty($objects)) return $this; $masterZone = $this->getMasterZoneName(); $globalZone = $this->getGlobalZoneName();