[icinga-checkins] icinga.org: icingaweb2/feature/setup-wizard-7163: Db\DbConnection: benchmark single row fetches

git at icinga.org git at icinga.org
Wed Nov 12 12:11:34 CET 2014


Module: icingaweb2
Branch: feature/setup-wizard-7163
Commit: 0d4d4930a95c0f7618b38d5345dd88bdac5def5a
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=0d4d4930a95c0f7618b38d5345dd88bdac5def5a

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue Nov 11 21:07:02 2014 +0100

Db\DbConnection: benchmark single row fetches

---

 library/Icinga/Data/Db/DbConnection.php |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/library/Icinga/Data/Db/DbConnection.php b/library/Icinga/Data/Db/DbConnection.php
index 5fb0873..8268689 100644
--- a/library/Icinga/Data/Db/DbConnection.php
+++ b/library/Icinga/Data/Db/DbConnection.php
@@ -216,7 +216,10 @@ class DbConnection implements Selectable
      */
     public function fetchRow(DbQuery $query)
     {
-        return $this->dbAdapter->fetchRow($query->getSelectQuery());
+        Benchmark::measure('DB is fetching row');
+        $result = $this->dbAdapter->fetchRow($query->getSelectQuery());
+        Benchmark::measure('DB row done');
+        return $result;
     }
 
     /**



More information about the icinga-checkins mailing list