@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.

Allow Multimeter samples to be grouped by ID

Summary: Ref T6930. This allows samples to be split apart even if they occurred in the same request.

Test Plan: {F391657}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6930

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

+19 -6
+19 -6
src/applications/multimeter/controller/MultimeterSampleController.php
··· 84 84 $rows = array(); 85 85 foreach ($data as $row) { 86 86 87 + if ($row['N'] == 1) { 88 + $events_col = $row['id']; 89 + } else { 90 + $events_col = $this->renderGroupingLink( 91 + $group, 92 + 'id', 93 + pht('%s Events', new PhutilNumber($row['N']))); 94 + } 95 + 87 96 if (isset($group['request'])) { 88 97 $request_col = $row['requestKey']; 89 98 if (!$with['request']) { ··· 168 177 } 169 178 170 179 $rows[] = array( 171 - ($row['N'] == 1) 172 - ? $row['id'] 173 - : pht('%s Events', new PhutilNumber($row['N'])), 180 + $events_col, 174 181 $request_col, 175 182 $viewer_col, 176 183 $context_col, ··· 209 216 )) 210 217 ->setColumnClasses( 211 218 array( 212 - 'n', 219 + null, 213 220 null, 214 221 null, 215 222 null, ··· 241 248 'viewer' => pht('By Viewer'), 242 249 'request' => pht('By Request'), 243 250 'label' => pht('By Label'), 251 + 'id' => pht('By ID'), 244 252 ); 245 253 246 254 $parts = array(); ··· 264 272 )); 265 273 } 266 274 267 - private function renderGroupingLink(array $group, $key) { 275 + private function renderGroupingLink(array $group, $key, $name = null) { 268 276 $group[] = $key; 269 277 $uri = $this->getGroupURI($group); 270 278 279 + if ($name === null) { 280 + $name = pht('(All)'); 281 + } 282 + 271 283 return phutil_tag( 272 284 'a', 273 285 array( 274 286 'href' => $uri, 275 287 'style' => 'font-weight: bold', 276 288 ), 277 - pht('(All)')); 289 + $name); 278 290 } 279 291 280 292 private function getGroupURI(array $group, $wipe = false) { ··· 318 330 'viewer' => 'eventViewerID', 319 331 'request' => 'requestKey', 320 332 'label' => 'eventLabelID', 333 + 'id' => 'id', 321 334 ); 322 335 } 323 336