From fb0df1fa259171edb77f65eb23cbf18af75f4294 Mon Sep 17 00:00:00 2001 From: Lufei Date: Tue, 16 May 2023 17:26:36 +0800 Subject: [PATCH] - Remove outputProfiling. --- framework/base/router.class.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index d1799613ea..b86aae7fe3 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -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) {