12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- $GLOBALS['XHPROF_LIB_ROOT'] = dirname(__FILE__) . '/../xhprof_lib';
- include_once $GLOBALS['XHPROF_LIB_ROOT'].'/display/xhprof.php';
- ini_set('max_execution_time', 100);
- $params = array(
- 'run' => array(XHPROF_STRING_PARAM, ''),
-
- 'source' => array(XHPROF_STRING_PARAM, 'xhprof'),
-
-
- 'func' => array(XHPROF_STRING_PARAM, ''),
-
- 'type' => array(XHPROF_STRING_PARAM, 'png'),
-
-
-
- 'threshold' => array(XHPROF_FLOAT_PARAM, 0.01),
-
- 'critical' => array(XHPROF_BOOL_PARAM, true),
-
- 'run1' => array(XHPROF_STRING_PARAM, ''),
-
- 'run2' => array(XHPROF_STRING_PARAM, '')
- );
- xhprof_param_init($params);
- if ($threshold < 0 || $threshold > 1) {
- $threshold = $params['threshold'][1];
- }
- if (!array_key_exists($type, $xhprof_legal_image_types)) {
- $type = $params['type'][1];
- }
- $xhprof_runs_impl = new XHProfRuns_Default();
- if (!empty($run)) {
-
- xhprof_render_image($xhprof_runs_impl, $run, $type,
- $threshold, $func, $source, $critical);
- } else {
-
- xhprof_render_diff_image($xhprof_runs_impl, $run1, $run2,
- $type, $threshold, $source);
- }
|