diff --git a/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php b/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php --- a/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php +++ b/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php @@ -410,8 +410,8 @@ $log = $this->logger; if ($log) { - $log->writeClusterEngineLogProperty('readWait', $read_wait); $log->writeClusterEngineLogProperty('writeWait', $write_wait); + $log->writeClusterEngineLogProperty('readWait', $read_wait); } } diff --git a/src/applications/diffusion/view/DiffusionPushLogListView.php b/src/applications/diffusion/view/DiffusionPushLogListView.php --- a/src/applications/diffusion/view/DiffusionPushLogListView.php +++ b/src/applications/diffusion/view/DiffusionPushLogListView.php @@ -41,9 +41,10 @@ $any_host = false; foreach ($logs as $log) { $repository = $log->getRepository(); + $event = $log->getPushEvent(); if ($remotes_visible) { - $remote_address = $log->getPushEvent()->getRemoteAddress(); + $remote_address = $event->getRemoteAddress(); } else { $remote_address = null; } @@ -79,10 +80,10 @@ phutil_tag('br'), $flag_names); - $reject_code = $log->getPushEvent()->getRejectCode(); + $reject_code = $event->getRejectCode(); if ($reject_code == $reject_herald) { - $rule_phid = $log->getPushEvent()->getRejectDetails(); + $rule_phid = $event->getRejectDetails(); $handle = $viewer->renderHandle($rule_phid); $reject_label = pht('Blocked: %s', $handle); } else { @@ -92,6 +93,11 @@ pht('Unknown ("%s")', $reject_code)); } + $host_wait = $this->formatMicroseconds($event->getHostWait()); + $write_wait = $this->formatMicroseconds($event->getWriteWait()); + $read_wait = $this->formatMicroseconds($event->getReadWait()); + $hook_wait = $this->formatMicroseconds($event->getHookWait()); + $rows[] = array( phutil_tag( 'a', @@ -107,7 +113,7 @@ $repository->getDisplayName()), $viewer->renderHandle($log->getPusherPHID()), $remote_address, - $log->getPushEvent()->getRemoteProtocol(), + $event->getRemoteProtocol(), $device, $log->getRefType(), $log->getRefName(), @@ -121,6 +127,10 @@ $flag_names, $reject_label, $viewer->formatShortDateTime($log->getEpoch()), + $host_wait, + $write_wait, + $read_wait, + $hook_wait, ); } @@ -140,6 +150,10 @@ pht('Flags'), pht('Result'), pht('Date'), + pht('Host Wait'), + pht('Write Wait'), + pht('Read Wait'), + pht('Hook Wait'), )) ->setColumnClasses( array( @@ -156,6 +170,10 @@ '', '', 'right', + 'n right', + 'n right', + 'n right', + 'n right', )) ->setColumnVisibility( array( @@ -170,4 +188,12 @@ return $table; } + private function formatMicroseconds($duration) { + if ($duration === null) { + return null; + } + + return pht('%sus', new PhutilNumber($duration)); + } + } diff --git a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php --- a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php +++ b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php @@ -162,6 +162,9 @@ id(new PhabricatorStringExportField()) ->setKey('resultDetails') ->setLabel(pht('Result Details')), + id(new PhabricatorIntExportField()) + ->setKey('hostWait') + ->setLabel(pht('Host Wait (us)')), id(new PhabricatorIntExportField()) ->setKey('writeWait') ->setLabel(pht('Write Wait (us)')), @@ -169,8 +172,8 @@ ->setKey('readWait') ->setLabel(pht('Read Wait (us)')), id(new PhabricatorIntExportField()) - ->setKey('hostWait') - ->setLabel(pht('Host Wait (us)')), + ->setKey('hookWait') + ->setLabel(pht('Hook Wait (us)')), ); if ($viewer->getIsAdmin()) { @@ -251,9 +254,10 @@ 'result' => $result, 'resultName' => $result_name, 'resultDetails' => $event->getRejectDetails(), + 'hostWait' => $event->getHostWait(), 'writeWait' => $event->getWriteWait(), 'readWait' => $event->getReadWait(), - 'hostWait' => $event->getHostWait(), + 'hookWait' => $event->getHookWait(), ); if ($viewer->getIsAdmin()) {