Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14333254
D19565.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D19565.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D19565: In "--trace" output, print elapsed miliseconds for ballparking performance issues
Attached
Detach File
Event Timeline
Log In to Comment