Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Custom implementation of iXHProfRuns. More...
Public Member Functions | |
get_run ($run_id, $type, &$run_desc) | |
Given one runid and one type, return the run data and some extra info in run_desc from DB. | |
prepare_run ($url) | |
save_run ($xhprof_data, $type, $run_id=null) | |
Given some run data, one type and, optionally, one runid store the information in DB. | |
set_reducedata (bool $reducedata) | |
Enable or disable reducing profiling data. | |
Protected Member Functions | |
reduce_run_data (array $info) | |
Reduce the run data to a more manageable size. | |
sum_calls ($sum, $data) | |
xhprof_topo_sort (array $info) | |
Sort the xhprof run pseudo-topologically, so all parents are always before their children. | |
Custom implementation of iXHProfRuns.
This class is one implementation of the iXHProfRuns interface, in charge of storing and retrieve profiling run data to/from DB (profiling table)
The interface only defines two methods to be defined: get_run() and save_run() we'll be implementing some more in order to keep all the rest of information in our runs properly handled.
moodle_xhprofrun::get_run | ( | $run_id, | |
$type, | |||
& | $run_desc ) |
Given one runid and one type, return the run data and some extra info in run_desc from DB.
Note that $type is completely ignored
Implements iXHProfRuns.
|
protected |
Reduce the run data to a more manageable size.
This removes from the run data all the entries that are matching a group of regular expressions.
The main use is to remove all the calls between "__Mustache" functions, which don't provide any useful information and make the call-graph too complex to be handled.
array | $info | The xhprof run data, original array. |
array | The xhprof run data, reduced array. |
moodle_xhprofrun::save_run | ( | $xhprof_data, | |
$type, | |||
$run_id = null ) |
Given some run data, one type and, optionally, one runid store the information in DB.
Note that $type is completely ignored
Implements iXHProfRuns.
moodle_xhprofrun::set_reducedata | ( | bool | $reducedata | ) |
Enable or disable reducing profiling data.
bool | $reducedata | Decide if we want to reduce profiling data (true) or no (false). |
|
protected |
Sort the xhprof run pseudo-topologically, so all parents are always before their children.
Note that this is not a proper, complex, recursive topological sorting algorithm, returning nodes that later have to be converted back to xhprof "pairs" but, instead, does the specific work to get those parent==>child (2 levels only) "pairs" sorted (parents always before children).
array | $info | The xhprof run data, original array. |
array | The xhprof run data, sorted array. |