3 final class DarkConsoleStartupPlugin
extends DarkConsolePlugin
{
5 public function getName() {
9 public function getDescription() {
10 return pht('Timing information about the startup sequence.');
14 * @phutil-external-symbol class PhabricatorStartup
16 public function generateData() {
17 return PhabricatorStartup
::getPhases();
20 public function renderPanel() {
21 $data = $this->getData();
23 // Compute the time offset and duration of each startup phase.
27 foreach ($data as $key => $value) {
32 $offset = (int)floor(1000 * ($value - $init));
34 $phases[$key] = array(
36 'offset' => $value - $init,
40 if ($prev_key !== null) {
41 $phases[$prev_key]['duration'] = $value - $phases[$prev_key]['time'];
48 foreach ($phases as $key => $phase) {
49 $offset_ms = (int)floor(1000 * $phase['offset']);
51 if (isset($phase['duration'])) {
52 $duration_us = (int)floor(1000000 * $phase['duration']);
59 pht('+%s ms', new PhutilNumber($offset_ms)),
60 ($duration_us === null)
62 : pht('%s us', new PhutilNumber($duration_us)),
67 return id(new AphrontTableView($rows))