Skip to content

Commit

Permalink
Catalog: Add benchmark measurements
Browse files Browse the repository at this point in the history
refs #13013
  • Loading branch information
Johannes Meyer committed Dec 12, 2016
1 parent 778f52d commit 3e957ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/translation/library/Translation/Catalog/Catalog.php
Expand Up @@ -7,6 +7,7 @@
use DateTime;
use Exception;
use IteratorAggregate;
use Icinga\Application\Benchmark;
use Icinga\Exception\IcingaException;
use Icinga\Module\Translation\Exception\CatalogEntryException;
use Icinga\Module\Translation\Exception\CatalogException;
Expand Down Expand Up @@ -58,6 +59,8 @@ public function __construct(CatalogHeader $header, array $entries)
*/
public static function fromArray(array $rawEntries)
{
Benchmark::measure('Catalog::fromArray()');

$header = null;
$entries = array();
foreach ($rawEntries as $key => $rawEntry) {
Expand Down Expand Up @@ -93,6 +96,8 @@ public static function fromArray(array $rawEntries)
*/
public static function fromPath($catalogPath)
{
Benchmark::measure('Catalog::fromPath()');

try {
return Catalog::fromArray(CatalogParser::parsePath($catalogPath));
} catch (CatalogHeaderException $e) {
Expand Down

0 comments on commit 3e957ca

Please sign in to comment.