\Horde_View_Helper_Benchmark

Measures the execution time of a block in a template and reports the result to the log.

Example:

<?php $bench = $this->benchmark('Notes section') ?> <?php echo $this->expensiveNotesOperation() ?> <?php $bench->end() ?>

Will add something like "Notes section (0.34523)" to the log.

You may give an optional logger level as the second argument ('debug', 'info', 'warn', 'error'). The default is 'info'. The level may also be given as a Horde_Log::* constant.

Summary

Methods
Properties
Constants
__construct()
__get()
__set()
__call()
benchmark()
No public properties found
No constants found
No protected methods found
$_view
N/A
No private methods found
No private properties found
N/A

Properties

$_view

$_view : \Horde_View

The parent view invoking the helper.

Type

\Horde_View

Methods

__construct()

__construct(\Horde_View  $view) 

Creates a helper for $view.

Parameters

\Horde_View $view

The view to help.

__get()

__get(  $name) 

Proxy on undefined property access (get).

Parameters

$name

__set()

__set(  $name,   $value) 

Proxy on undefined property access (set).

Parameters

$name
$value

__call()

__call(string  $method, array  $args) : mixed

Call chaining so members of the view can be called (including other helpers).

Parameters

string $method

The method.

array $args

The parameters for the method.

Returns

mixed —

The result of the method.

benchmark()

benchmark(string  $message = 'Benchmarking', string|integer  $level = 'info') : \Horde_View_Helper_Benchmark_Timer

Starts a new benchmark.

Parameters

string $message

Message to log after the benchmark has ended.

string|integer $level

Log level to log after the benchmark has ended.

Returns

\Horde_View_Helper_Benchmark_Timer

A benchmark timer object.