Page MenuHomePhabricator

D19565.diff
No OneTemporary

D19565.diff

diff --git a/src/serviceprofiler/PhutilServiceProfiler.php b/src/serviceprofiler/PhutilServiceProfiler.php
--- a/src/serviceprofiler/PhutilServiceProfiler.php
+++ b/src/serviceprofiler/PhutilServiceProfiler.php
@@ -7,12 +7,14 @@
final class PhutilServiceProfiler extends Phobject {
private static $instance;
+
private $listeners = array();
private $events = array();
private $logSize = 0;
private $discardMode = false;
private $collectStackTraces;
+ private $zeroTime;
private function __construct() {}
@@ -184,11 +186,18 @@
new PhutilNumber((int)(1000000 * $data['duration'])));
}
+ $instance = self::getInstance();
+ if (!$instance->zeroTime) {
+ $instance->zeroTime = microtime(true);
+ }
+ $elapsed = microtime(true) - $instance->zeroTime;
+
$console = PhutilConsole::getConsole();
$console->writeLog(
- "%s [%s] <%s> %s\n",
+ "%s [%s] (+%s) <%s> %s\n",
$mark,
$id,
+ pht('%s', new PhutilNumber((int)(1000 * $elapsed))),
$type,
self::escapeProfilerStringForDisplay($desc));
}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 4:44 PM (1 h, 2 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6899102
Default Alt Text
D19565.diff (1 KB)

Event Timeline