@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Put push log "hookWait" to data export and add all wait values to UI

Summary:
Depends on D19797. Ref T13216.

- Put the new `hookWait` in the export and the UI.
- Put the existing waits in the UI, not just the export.
- Make order consistent: host, write, read, hook (this is the order the timers start in).

Test Plan: Pushed some stuff, viewed web UI and saw sensible numbers, exported data and got the same values.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13216

Differential Revision: https://secure.phabricator.com/D19798

+38 -8
+1 -1
src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
··· 410 410 411 411 $log = $this->logger; 412 412 if ($log) { 413 - $log->writeClusterEngineLogProperty('readWait', $read_wait); 414 413 $log->writeClusterEngineLogProperty('writeWait', $write_wait); 414 + $log->writeClusterEngineLogProperty('readWait', $read_wait); 415 415 } 416 416 } 417 417
+30 -4
src/applications/diffusion/view/DiffusionPushLogListView.php
··· 41 41 $any_host = false; 42 42 foreach ($logs as $log) { 43 43 $repository = $log->getRepository(); 44 + $event = $log->getPushEvent(); 44 45 45 46 if ($remotes_visible) { 46 - $remote_address = $log->getPushEvent()->getRemoteAddress(); 47 + $remote_address = $event->getRemoteAddress(); 47 48 } else { 48 49 $remote_address = null; 49 50 } ··· 79 80 phutil_tag('br'), 80 81 $flag_names); 81 82 82 - $reject_code = $log->getPushEvent()->getRejectCode(); 83 + $reject_code = $event->getRejectCode(); 83 84 84 85 if ($reject_code == $reject_herald) { 85 - $rule_phid = $log->getPushEvent()->getRejectDetails(); 86 + $rule_phid = $event->getRejectDetails(); 86 87 $handle = $viewer->renderHandle($rule_phid); 87 88 $reject_label = pht('Blocked: %s', $handle); 88 89 } else { ··· 92 93 pht('Unknown ("%s")', $reject_code)); 93 94 } 94 95 96 + $host_wait = $this->formatMicroseconds($event->getHostWait()); 97 + $write_wait = $this->formatMicroseconds($event->getWriteWait()); 98 + $read_wait = $this->formatMicroseconds($event->getReadWait()); 99 + $hook_wait = $this->formatMicroseconds($event->getHookWait()); 100 + 95 101 $rows[] = array( 96 102 phutil_tag( 97 103 'a', ··· 107 113 $repository->getDisplayName()), 108 114 $viewer->renderHandle($log->getPusherPHID()), 109 115 $remote_address, 110 - $log->getPushEvent()->getRemoteProtocol(), 116 + $event->getRemoteProtocol(), 111 117 $device, 112 118 $log->getRefType(), 113 119 $log->getRefName(), ··· 121 127 $flag_names, 122 128 $reject_label, 123 129 $viewer->formatShortDateTime($log->getEpoch()), 130 + $host_wait, 131 + $write_wait, 132 + $read_wait, 133 + $hook_wait, 124 134 ); 125 135 } 126 136 ··· 140 150 pht('Flags'), 141 151 pht('Result'), 142 152 pht('Date'), 153 + pht('Host Wait'), 154 + pht('Write Wait'), 155 + pht('Read Wait'), 156 + pht('Hook Wait'), 143 157 )) 144 158 ->setColumnClasses( 145 159 array( ··· 156 170 '', 157 171 '', 158 172 'right', 173 + 'n right', 174 + 'n right', 175 + 'n right', 176 + 'n right', 159 177 )) 160 178 ->setColumnVisibility( 161 179 array( ··· 168 186 )); 169 187 170 188 return $table; 189 + } 190 + 191 + private function formatMicroseconds($duration) { 192 + if ($duration === null) { 193 + return null; 194 + } 195 + 196 + return pht('%sus', new PhutilNumber($duration)); 171 197 } 172 198 173 199 }
+7 -3
src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
··· 163 163 ->setKey('resultDetails') 164 164 ->setLabel(pht('Result Details')), 165 165 id(new PhabricatorIntExportField()) 166 + ->setKey('hostWait') 167 + ->setLabel(pht('Host Wait (us)')), 168 + id(new PhabricatorIntExportField()) 166 169 ->setKey('writeWait') 167 170 ->setLabel(pht('Write Wait (us)')), 168 171 id(new PhabricatorIntExportField()) 169 172 ->setKey('readWait') 170 173 ->setLabel(pht('Read Wait (us)')), 171 174 id(new PhabricatorIntExportField()) 172 - ->setKey('hostWait') 173 - ->setLabel(pht('Host Wait (us)')), 175 + ->setKey('hookWait') 176 + ->setLabel(pht('Hook Wait (us)')), 174 177 ); 175 178 176 179 if ($viewer->getIsAdmin()) { ··· 251 254 'result' => $result, 252 255 'resultName' => $result_name, 253 256 'resultDetails' => $event->getRejectDetails(), 257 + 'hostWait' => $event->getHostWait(), 254 258 'writeWait' => $event->getWriteWait(), 255 259 'readWait' => $event->getReadWait(), 256 - 'hostWait' => $event->getHostWait(), 260 + 'hookWait' => $event->getHookWait(), 257 261 ); 258 262 259 263 if ($viewer->getIsAdmin()) {