当前位置: 首页>>代码示例>>PHP>>正文


PHP Profiler::application方法代码示例

本文整理汇总了PHP中Profiler::application方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::application方法的具体用法?PHP Profiler::application怎么用?PHP Profiler::application使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Profiler的用法示例。


在下文中一共展示了Profiler::application方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: smarty_function_Kohana_profile

/**
 * Smarty {fetch} plugin
 *
 * Type:     function<br>
 * Name:     fetch<br>
 * Purpose:  fetch file, web or ftp data and display results
 * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch}
 *       (Smarty online manual)
 * @author Monte Ohrt <monte at ohrt dot com>
 * @param array
 * @param Smarty
 * @return string|null if the assign parameter is passed, Smarty assigns the
 *                     result to a template variable
 */
function smarty_function_Kohana_profile($params, &$smarty)
{
    $groups = Profiler::groups();
    $profile = array();
    foreach ($groups as $group_name => $group) {
        foreach ($group as $name => $member) {
            $stats = Profiler::stats($member);
            $profile[] = array('group_name' => $group_name, 'name' => $name, 'count' => count($member), 'total_time' => $stats['total']['time'], 'min_time' => $stats['min']['time'], 'max_time' => $stats['max']['time'], 'average_time' => $stats['average']['time'], 'total_memory' => $stats['total']['memory'], 'min_memory' => $stats['min']['memory'], 'max_memory' => $stats['max']['memory'], 'average_memory' => $stats['average']['memory']);
        }
    }
    $stats = Profiler::application();
    $profile[] = array('group_name' => 'Application timings', 'name' => 'Application timings', 'count' => $stats['count'], 'total_time' => $stats['total']['time'], 'min_time' => $stats['min']['time'], 'max_time' => $stats['max']['time'], 'average_time' => $stats['average']['time'], 'total_memory' => $stats['total']['memory'], 'min_memory' => $stats['min']['memory'], 'max_memory' => $stats['max']['memory'], 'average_memory' => $stats['average']['memory']);
    $smarty->assign('Kohana_profile', $profile);
}
开发者ID:pg7812,项目名称:kohana-module-smarty,代码行数:28,代码来源:function.Kohana_profile.php

示例2: __destruct

 public function __destruct()
 {
     $app = Profiler::application();
     $group = Profiler::groups();
     $table = array();
     $table[] = array('Type', 'Time (s)', 'Mem (kb)');
     foreach ($group as $rName => $route) {
         $table[] = array($rName);
         foreach ($route as $tName => $type) {
             foreach ($type as $stat) {
                 $stats = Profiler::total($stat);
                 $table[] = array($tName, number_format($stats[0], 6), number_format($stats[1] / 1024, 4));
             }
         }
     }
     $this->fire->info(Session::instance()->as_array(), 'Session');
     $this->fire->group('Stats: ' . $app['count']);
     $this->fire->info('Min:	' . number_format($app['min']['time'], 6) . 's ' . number_format($app['min']['memory'] / 1024, 4) . 'kb');
     $this->fire->info('Max:	' . number_format($app['max']['time'], 6) . 's ' . number_format($app['max']['memory'] / 1024, 4) . 'kb');
     $this->fire->info('Average: ' . number_format($app['average']['time'], 6) . 's ' . number_format($app['average']['memory'] / 1024, 4) . 'kb');
     $this->fire->info('Total:	' . number_format($app['total']['time'], 6) . 's ' . number_format($app['total']['memory'] / 1024, 4) . 'kb');
     $this->fire->groupEnd();
     //$this->fire->table('Execution stats ('.number_format($endTime, 6).'s '.number_format($endMem, 4).'kb)', $table);
 }
开发者ID:pedrosland,项目名称:kohana-firephp,代码行数:24,代码来源:firePHP.php

示例3: render_stats

 /**
  * Print some render stats
  *
  * @return string
  */
 public static function render_stats()
 {
     $run = Profiler::application();
     $run = $run['current'];
     $queries = Profiler::groups();
     $queries = count($queries['database (default)']);
     return "Page rendered in " . Num::format($run['time'], 3) . " seconds using " . Num::format($run['memory'] / 1024 / 1024, 2) . "MB and " . $queries . " queries.";
 }
开发者ID:AlexKupreev,项目名称:kohanut-core,代码行数:13,代码来源:core.php

示例4: __

			</td>
			<?php 
        }
        ?>
		</tr>
		<?php 
    }
    ?>
	</table>
	<?php 
}
?>

	<table class="profiler">
		<?php 
$stats = Profiler::application();
?>
		<tr class="final mark time">
			<th class="name" rowspan="2" scope="rowgroup"><?php 
echo __('Application Execution') . ' (' . $stats['count'] . ')';
?>
</th>
			<?php 
foreach ($application_cols as $key) {
    ?>
			<td class="<?php 
    echo $key;
    ?>
"><?php 
    echo number_format($stats[$key]['time'], 6);
    ?>
开发者ID:noikiy,项目名称:kohana,代码行数:31,代码来源:stats.php

示例5: getAppTime

 /**
  * @return mixed
  */
 private static function getAppTime()
 {
     $tmp = Profiler::application();
     return $tmp['current']['time'];
 }
开发者ID:astar3086,项目名称:studio_logistic,代码行数:8,代码来源:ProfilerToolbar.php

示例6: fetch_data

 public function fetch_data()
 {
     return array('stats' => Profiler::application(), 'application_cols' => array('min', 'max', 'average'));
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:4,代码来源:profiler.php

示例7: get_benchmarks

 /**
  * Creates a formatted array of all Benchmarks
  *
  * @return array formatted benchmarks
  */
 public static function get_benchmarks()
 {
     if (Kohana::$profiling == FALSE) {
         return array();
     }
     if (self::$_benchmarks !== FALSE) {
         return self::$_benchmarks;
     }
     $groups = Profiler::groups();
     $result = array();
     foreach (array_keys($groups) as $group) {
         if (strpos($group, 'database (') === FALSE) {
             foreach ($groups[$group] as $name => $marks) {
                 $stats = Profiler::stats($marks);
                 $result[$group][] = array('name' => $name, 'count' => count($marks), 'total_time' => $stats['total']['time'], 'avg_time' => $stats['average']['time'], 'total_memory' => $stats['total']['memory'], 'avg_memory' => $stats['average']['memory']);
             }
         }
     }
     // add total stats
     $total = Profiler::application();
     $result['application'] = array('count' => 1, 'total_time' => $total['current']['time'], 'avg_time' => $total['average']['time'], 'total_memory' => $total['current']['memory'], 'avg_memory' => $total['average']['memory']);
     self::$_benchmarks = $result;
     return $result;
 }
开发者ID:bosoy83,项目名称:progtest,代码行数:29,代码来源:debugtoolbar.php

示例8: after

 public function after()
 {
     if (Kohana::$profiling === TRUE) {
         xml::to_XML(array('benchmark' => Profiler::application()), $this->xml_meta);
     }
     if ($this->auto_render == TRUE) {
         // Render the template immediately after the controller method
         $this->render();
     }
 }
开发者ID:rockymontana,项目名称:kohana-module-pajas,代码行数:10,代码来源:xsltcontroller.php

示例9: __

</th>
                <th class="profiler_min"><?php 
echo __('runtime');
?>
</th>
                <th class="profiler_max"><?php 
echo __('memory');
?>
</th>
                <th class="profiler_total"><?php 
echo __('include file');
?>
</th>
            </tr>
        <?php 
foreach (array('Core Execution' => Profiler::core_system(), 'Application Execution' => Profiler::application()) as $key => $stats) {
    ?>
            <tr class="profiler_mark profiler_time">
                <th class="profiler_name" style="padding: 8px 6px;"><?php 
    echo __($key);
    ?>
</th>
                <td class="profiler_min">
                <?php 
    echo number_format($stats['max']['time'], 6), ' ', __('seconds');
    ?>
                </td>
                <td class="profiler_max">
                <?php 
    echo number_format($stats['max']['memory'] / 1024, 4), ' kb';
    ?>
开发者ID:xiaodin1,项目名称:myqee,代码行数:31,代码来源:profiler.view.php

示例10: get_benchmark_application

 /**
  * Get application benchmark
  *
  * <code>
  * Debugger::get_benchmark_application()
  * </code>
  *
  * @static
  * @return StdClass
  */
 public static function get_benchmark_application()
 {
     if (Debugger::$_benchmark_application !== null) {
         return Debugger::$_benchmark_application;
     }
     $benchmark_application = new StdClass();
     $profiler_application = Profiler::application();
     $benchmark_application->min = $profiler_application['min'];
     $benchmark_application->max = $profiler_application['max'];
     $benchmark_application->total = $profiler_application['total'];
     $benchmark_application->average = $profiler_application['average'];
     $benchmark_application->current = $profiler_application['current'];
     return Debugger::$_benchmark_application = $benchmark_application;
 }
开发者ID:nexeck,项目名称:kohana-debugger,代码行数:24,代码来源:debugger.php

示例11: benchmark

 public function benchmark($table = FALSE)
 {
     if ($this->enabled) {
         foreach (Profiler::groups() as $group => $benchmarks) {
             $tablename = ucfirst($group);
             // Exclude database unless specifically run
             if (empty($table) and strpos($tablename, 'Database') === FALSE or strpos($tablename, $table) === 0) {
                 $row = array(array(__('Benchmark'), __('Min'), __('Max'), __('Average'), __('Total')));
                 foreach ($benchmarks as $name => $tokens) {
                     $stats = Profiler::stats($tokens);
                     $cell = array($name . ' (' . count($tokens) . ')');
                     foreach (array('min', 'max', 'average', 'total') as $key) {
                         $cell[] = ' ' . number_format($stats[$key]['time'], 6) . ' ' . __('seconds');
                     }
                     $row[] = $cell;
                 }
                 $cell = array('');
                 foreach (array('min', 'max', 'average', 'total') as $key) {
                     $cell[] = ' ' . number_format($stats[$key]['memory'] / 1024, 4) . ' kb';
                 }
                 $row[] = $cell;
                 // Translate before passing...
                 $this->fb(array(__($tablename), $row), FirePHP::TABLE);
             }
         }
         if (empty($table) || strpos('Application', $table) === 0) {
             $stats = Profiler::application();
             $tablename = array(__('Application Execution') . ' (' . $stats['count'] . ')');
             $row = array(array('', 'min', 'max', 'average', 'current'));
             $cell = array('Time');
             foreach (array('min', 'max', 'average', 'current') as $key) {
                 $cell[] = number_format($stats[$key]['time'], 6) . ' ' . __('seconds');
             }
             $row[] = $cell;
             $cell = array('Memory');
             foreach (array('min', 'max', 'average', 'current') as $key) {
                 $cell[] = number_format($stats[$key]['memory'] / 1024, 4) . ' kb';
             }
             $row[] = $cell;
             $this->fb(array($tablename, $row), FirePHP::TABLE);
         }
     }
     return $this;
 }
开发者ID:hkilter,项目名称:OpenSupplyChains,代码行数:44,代码来源:firephp.php


注:本文中的Profiler::application方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。