- Remove outputProfiling.

This commit is contained in:
Lufei
2023-05-16 17:26:36 +08:00
parent f71871a6cc
commit fb0df1fa25
-23
View File
@@ -744,27 +744,6 @@ class baseRouter
if(!empty($this->config->debug) && $this->config->debug >= 3) $this->dbh->exec('SET profiling = 1');
}
/**
* 输出数据库性能采样结果(Server-Timing)。
* Output database profiling(Server-Timing).
*
* @access protected
* @return void
*/
protected function outputProfiling(): void
{
if(empty($this->config->debug) || $this->config->debug < 3) return;
/* MySQL profiling. */
$profiling = $this->dbh->query('SHOW PROFILES')->fetchAll(PDO::FETCH_ASSOC);
foreach($profiling as $prof)
{
header('Server-Timing: db;desc="SQL: ' . $prof['Query'] . '";dur=' . $prof['Duration'] * 1000, false);
}
header('Server-Timing: app;desc="PHP: Total";dur=' . (getTime() - $this->startTime) * 1000, false);
}
/**
* 启用Xhprof。
* Setup xhprof.
@@ -2336,7 +2315,6 @@ class baseRouter
try {
if(is_null($this->params) and !$this->setParams())
{
$this->outputProfiling();
$this->outputXhprof();
return false;
}
@@ -2346,7 +2324,6 @@ class baseRouter
call_user_func_array(array($module, $this->methodName), $this->params);
$this->checkAPIFile();
$this->outputProfiling();
$this->outputXhprof();
return $module;
} catch (EndResponseException $endResponseException) {