1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

Don't add resources to Multimeter when there's no multimeter running

Summary: Fixes T8058. Don't add a Multimeter event if we aren't running multimeter (e.g., in unit tests).

Test Plan: Will `arc unit --everything`.

Reviewers: joshuaspence, btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T8058

Differential Revision: https://secure.phabricator.com/D12699
This commit is contained in:
epriestley 2015-05-04 09:15:15 -07:00
parent 1dfe1f49f7
commit 1168a8c0a0

View file

@ -144,8 +144,11 @@ final class CelerityStaticResourceResponse {
$uri = $this->getURI($map, $name);
$type = $map->getResourceTypeForName($name);
$event_type = MultimeterEvent::TYPE_STATIC_RESOURCE;
MultimeterControl::getInstance()->newEvent($event_type, 'rsrc.'.$name, 1);
$multimeter = MultimeterControl::getInstance();
if ($multimeter) {
$event_type = MultimeterEvent::TYPE_STATIC_RESOURCE;
$multimeter->newEvent($event_type, 'rsrc.'.$name, 1);
}
switch ($type) {
case 'css':