Page MenuHomePhabricator
Paste P2114

(An Untitled Masterwork)
ActivePublic

Authored by amckinley on Feb 20 2019, 9:03 PM.
Tags
None
Referenced Files
F6225609: raw.txt
Feb 20 2019, 9:03 PM
Subscribers
None
$date_archived = $completed_task->getArchivedEpoch();
$queue_seconds = $date_archived - $completed_task->getDateCreated();
// The task may have completed in the same epoch second it was created.
if ((int)$queue_seconds > 0)
$sec_in_us = phutil_units('1 second in microseconds');
$queue_us = $queue_seconds * $sec_in_us;
$queue_exclusive_us = $queue_us - $duration;
$queue_exclusive_seconds = $queue_exclusive_us / $sec_in_us;
$rounded = floor($queue_exclusive_seconds);
$completed_info[$class]['queueTime'] += $queue_exclusive_seconds;
phlog("got {$queue_seconds}s, {$queue_exclusive_seconds}us, res={$rounded} id={$completed_task->getID()}");
}