SelectPaginationAdapter: add benchmark

This commit is contained in:
Thomas Gelf 2017-08-18 11:00:34 +02:00
parent 7b9f90e978
commit 7780c0b11b

View File

@ -2,6 +2,7 @@
namespace ipl\Db\Zf1; namespace ipl\Db\Zf1;
use Icinga\Application\Benchmark;
use ipl\Data\Paginatable; use ipl\Data\Paginatable;
use Zend_Db_Select as ZfSelect; use Zend_Db_Select as ZfSelect;
@ -27,9 +28,13 @@ class SelectPaginationAdapter implements Paginatable
public function count() public function count()
{ {
return $this->query->getAdapter()->fetchOne( Benchmark::measure('Running count() for pagination');
$count = $this->query->getAdapter()->fetchOne(
$this->getCountQuery() $this->getCountQuery()
); );
Benchmark::measure("Counted $count rows");
return $count;
} }
public function limit($count = null, $offset = null) public function limit($count = null, $offset = null)