本文整理汇总了PHP中CApp::getOuputBandwidth方法的典型用法代码示例。如果您正苦于以下问题:PHP CApp::getOuputBandwidth方法的具体用法?PHP CApp::getOuputBandwidth怎么用?PHP CApp::getOuputBandwidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApp
的用法示例。
在下文中一共展示了CApp::getOuputBandwidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: round
// Stop chrono if not already done
$chrono = CApp::$chrono;
if ($chrono->step > 0) {
$chrono->stop();
}
$log->duration += round(floatval($chrono->total), 3);
// System probes
$rusage = getrusage();
$log->processus += round(floatval($rusage["ru_utime.tv_usec"]) / 1000000 + $rusage["ru_utime.tv_sec"], 3);
$log->processor += round(floatval($rusage["ru_stime.tv_usec"]) / 1000000 + $rusage["ru_stime.tv_sec"], 3);
$log->peak_memory += memory_get_peak_usage();
// SQL stats
$log->request += round(floatval($ds->chrono->total), 3);
$log->nb_requests += $ds->chrono->nbSteps;
// Bandwidth
$log->size += CApp::getOuputBandwidth();
//$log->other_bandwidth += CApp::getOtherBandwidth();
// Error log stats
$log->errors += CApp::$performance["error"];
$log->warnings += CApp::$performance["warning"];
$log->notices += CApp::$performance["notice"];
CAccessLog::bufferize(array($log));
if (!CAppUI::conf("log_datasource_metrics")) {
return;
}
$dslogs = array();
foreach (CSQLDataSource::$dataSources as $_datasource) {
if ($_datasource) {
$dslog = new CDataSourceLog();
$dslog->module_action_id = $log->module_action_id;
$dslog->datasource = $_datasource->dsn;