From 7780c0b11b6de7ecfd83a1ea08765c8dd3ec044d Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 18 Aug 2017 11:00:34 +0200 Subject: [PATCH] SelectPaginationAdapter: add benchmark --- library/vendor/ipl/Db/Zf1/SelectPaginationAdapter.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/vendor/ipl/Db/Zf1/SelectPaginationAdapter.php b/library/vendor/ipl/Db/Zf1/SelectPaginationAdapter.php index 122bb12c..4fae9685 100644 --- a/library/vendor/ipl/Db/Zf1/SelectPaginationAdapter.php +++ b/library/vendor/ipl/Db/Zf1/SelectPaginationAdapter.php @@ -2,6 +2,7 @@ namespace ipl\Db\Zf1; +use Icinga\Application\Benchmark; use ipl\Data\Paginatable; use Zend_Db_Select as ZfSelect; @@ -27,9 +28,13 @@ class SelectPaginationAdapter implements Paginatable public function count() { - return $this->query->getAdapter()->fetchOne( + Benchmark::measure('Running count() for pagination'); + $count = $this->query->getAdapter()->fetchOne( $this->getCountQuery() ); + Benchmark::measure("Counted $count rows"); + + return $count; } public function limit($count = null, $offset = null)