Horde_View_Helper_Benchmark
extends Horde_View_Helper_Base
in package
Measures the execution time of a block in a template and reports the result to the log.
Example:
benchmark('Notes section') ?>
expensiveNotesOperation() ?>
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.
Tags
Table of Contents
- $_view : Horde_View
- The parent view invoking the helper.
- __call() : mixed
- Call chaining so members of the view can be called (including other helpers).
- __construct() : mixed
- Creates a helper for $view.
- __get() : mixed
- Proxy on undefined property access (get).
- __set() : mixed
- Proxy on undefined property access (set).
- benchmark() : Horde_View_Helper_Benchmark_Timer
- Starts a new benchmark.
Properties
$_view
The parent view invoking the helper.
protected
Horde_View
$_view
Methods
__call()
Call chaining so members of the view can be called (including other helpers).
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
-
The method.
- $args : array<string|int, mixed>
-
The parameters for the method.
Return values
mixed —The result of the method.
__construct()
Creates a helper for $view.
public
__construct(Horde_View $view) : mixed
Parameters
- $view : Horde_View
-
The view to help.
Return values
mixed —__get()
Proxy on undefined property access (get).
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —__set()
Proxy on undefined property access (set).
public
__set(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
Return values
mixed —benchmark()
Starts a new benchmark.
public
benchmark([string $message = 'Benchmarking' ][, string|int $level = 'info' ]) : Horde_View_Helper_Benchmark_Timer
Parameters
- $message : string = 'Benchmarking'
-
Message to log after the benchmark has ended.
- $level : string|int = 'info'
-
Log level to log after the benchmark has ended.
Return values
Horde_View_Helper_Benchmark_Timer —A benchmark timer object.