function xhprof_compute_inclusive_times in XHProf 6
Same name and namespace in other branches
- 7 xhprof.inc \xhprof_compute_inclusive_times()
1 call to xhprof_compute_inclusive_times()
- xhprof_compute_flat_info in ./xhprof.inc
- Analyze hierarchical raw data, and compute per-function (flat)
inclusive and exclusive metrics.
File
- ./xhprof.inc, line 1643
Code
function xhprof_compute_inclusive_times($raw_data) {
$metrics = xhprof_get_metrics($raw_data);
$symbol_tab = array();
foreach ($raw_data as $parent_child => $info) {
list($parent, $child) = xhprof_parse_parent_child($parent_child);
if ($parent == $child) {
watchdog("Error in Raw Data: parent & child are both: %parent", array(
'%parent' => $parent,
));
return;
}
if (!isset($symbol_tab[$child])) {
$symbol_tab[$child] = array(
"ct" => $info["ct"],
);
foreach ($metrics as $metric) {
$symbol_tab[$child][$metric] = $info[$metric];
}
}
else {
$symbol_tab[$child]["ct"] += $info["ct"];
foreach ($metrics as $metric) {
$symbol_tab[$child][$metric] += $info[$metric];
}
}
}
return $symbol_tab;
}