本文整理汇总了PHP中XHProfRuns_Default::load_profile方法的典型用法代码示例。如果您正苦于以下问题:PHP XHProfRuns_Default::load_profile方法的具体用法?PHP XHProfRuns_Default::load_profile怎么用?PHP XHProfRuns_Default::load_profile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XHProfRuns_Default
的用法示例。
在下文中一共展示了XHProfRuns_Default::load_profile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_summary
function get_summary($file_path, $probe = null)
{
$xhprof_data = XHProfRuns_Default::load_profile($file_path);
$xhprof_data = xhprof_compute_flat_info($xhprof_data, $totals);
$probe_count = 0;
if ($probe != null && isset($xhprof_data[$probe])) {
$probe_count = $xhprof_data[$probe]['ct'];
}
return array('pmu' => isset($totals['pmu']) ? $totals['pmu'] : '', 'mu' => isset($totals['mu']) ? $totals['mu'] : '', 'wt' => $totals['wt'], 'cpu' => $totals['cpu'], 'nbr' => $probe_count);
}
示例2: get_top_functions
function get_top_functions($profile, $metric_list, $how_many)
{
global $metric;
$tots = null;
$profile = XHProfRuns_Default::load_profile($profile);
$profile = xhprof_compute_flat_info($profile, $tots);
$result = array();
foreach ($metric_list as $metric => $blurb) {
try {
$metric_array = array_map("filter_metric", $profile);
uasort($metric_array, 'compare');
$top_x = array_slice($metric_array, 0, $how_many);
$metric_total = array_sum($metric_array);
$metric_sub_total = array_sum($top_x);
$top_x["*others*"] = $metric_total - $metric_sub_total;
$result[$blurb] = array_map(null, array_keys($top_x), array_values($top_x));
} catch (Exception $e) {
error_log("Processing metric {$m} failed");
}
}
return $result;
}
示例3: slow_page
function slow_page($dir_path, $profile_name, $max_time, &$flat_profile)
{
// XXX: xhprof depends on this global for doing entry counts
global $display_calls;
$display_calls = true;
$profile = XHProfRuns_Default::load_profile("{$dir_path}/{$profile_name}");
$dummy = null;
$flat_profile = xhprof_compute_flat_info($profile, $dummy);
return $flat_profile["main()"]["wt"];
}
示例4: combine_files
function combine_files($files, $game_name, $pattern, $output)
{
$combined = array();
$matches = null;
#$pattern = "/[0-9]+\.(.*)\.extract/";
foreach ($files as $file) {
if (preg_match($pattern, basename($file), $matches)) {
$key = $matches[1];
$combined[$key] = XHProfRuns_Default::load_profile($file);
}
}
file_put_contents($output, serialize($combined));
}
示例5: to_array
function to_array($filename)
{
if (!file_exists($filename)) {
return null;
}
$array = null;
try {
$array = XHProfRuns_Default::load_profile($filename);
} catch (Exception $ex) {
var_dump($ex->getTrace());
}
return $array;
}