1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Make everything 1000x or 1000000x slower

Summary:
In the great `pht()` conversion, some strings like "123,456" are now being printed as numbers with "%d". These come out as "123" instead of "123,456".

Use "%s" and "PhutilNumber" to present numbers with comma groupings.

Test Plan:
  - Viewed DarkConsole.
  - Viewed conduit logs.
  - Viewed daemon logs.
  - Grepped for `%d ms` and `%d us`.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D12979
This commit is contained in:
epriestley 2015-05-23 05:36:02 -07:00
parent 6481884d26
commit 7d757483a0
5 changed files with 9 additions and 7 deletions

View file

@ -98,7 +98,7 @@ final class PhabricatorConduitLogController
array($call->getMethod(), $client),
$status,
$call->getError(),
pht('%d us', number_format($call->getDuration())),
pht('%s us', new PhutilNumber($call->getDuration())),
phabricator_datetime($call->getDateCreated(), $viewer),
);
}

View file

@ -198,7 +198,7 @@ final class DarkConsoleServicesPlugin extends DarkConsolePlugin {
$summary[] = array(
$type,
number_format($counts[$type]),
pht('%d us', number_format((int)(1000000 * $totals[$type]))),
pht('%s us', new PhutilNumber((int)(1000000 * $totals[$type]))),
sprintf('%.1f%%', 100 * $totals[$type] / $page_total),
);
}
@ -258,10 +258,12 @@ final class DarkConsoleServicesPlugin extends DarkConsolePlugin {
break;
}
$offset = ($row['begin'] - $data['start']);
$rows[] = array(
$row['type'],
pht('+%d ms', number_format(1000 * ($row['begin'] - $data['start']))),
pht('%d us', number_format(1000000 * $row['duration'])),
pht('+%s ms', new PhutilNumber(1000 * $offset)),
pht('%s us', new PhutilNumber(1000000 * $row['duration'])),
$info,
$analysis,
);

View file

@ -50,7 +50,7 @@ final class PhabricatorDaemonConsoleController
$rows[] = array(
$class,
number_format($info['n']),
pht('%d us', number_format((int)($info['duration'] / $info['n']))),
pht('%s us', new PhutilNumber((int)($info['duration'] / $info['n']))),
);
}

View file

@ -141,7 +141,7 @@ final class PhabricatorWorkerTaskDetailController
$expires);
if ($task->isArchived()) {
$duration = pht('%d us', number_format($task->getDuration()));
$duration = pht('%s us', new PhutilNumber($task->getDuration()));
} else {
$duration = phutil_tag('em', array(), pht('Not Completed'));
}

View file

@ -125,7 +125,7 @@ final class HeraldTranscriptSearchEngine
}
$item->addAttribute($handles[$xscript->getObjectPHID()]->renderLink());
$item->addAttribute(
pht('%d ms', number_format((int)(1000 * $xscript->getDuration()))));
pht('%s ms', new PhutilNumber((int)(1000 * $xscript->getDuration()))));
$item->addIcon(
'none',
phabricator_datetime($xscript->getTime(), $viewer));