mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-01-11 07:11:03 +01:00
Log two times per linter instead of N
Summary: This number seems more interesting and it includes time for resolving futures which is the main part of some linters. Test Plan: $ arc --trace lint Reviewers: fdeliege, epriestley Reviewed By: epriestley CC: aran, epriestley, Korvin Differential Revision: https://secure.phabricator.com/D5075
This commit is contained in:
parent
e33bd82c42
commit
b758e3737c
1 changed files with 23 additions and 15 deletions
|
@ -229,26 +229,27 @@ abstract class ArcanistLintEngine {
|
||||||
$paths = array_values($paths);
|
$paths = array_values($paths);
|
||||||
|
|
||||||
if ($paths) {
|
if ($paths) {
|
||||||
$linter->willLintPaths($paths);
|
|
||||||
$profiler = PhutilServiceProfiler::getInstance();
|
$profiler = PhutilServiceProfiler::getInstance();
|
||||||
foreach ($paths as $path) {
|
|
||||||
$linter->willLintPath($path);
|
|
||||||
$call_id = $profiler->beginServiceCall(array(
|
$call_id = $profiler->beginServiceCall(array(
|
||||||
'type' => 'lint',
|
'type' => 'lint',
|
||||||
'linter' => get_class($linter),
|
'linter' => get_class($linter),
|
||||||
'path' => $path,
|
'paths' => $paths,
|
||||||
));
|
));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
$linter->willLintPaths($paths);
|
||||||
|
foreach ($paths as $path) {
|
||||||
|
$linter->willLintPath($path);
|
||||||
$linter->lintPath($path);
|
$linter->lintPath($path);
|
||||||
|
if ($linter->didStopAllLinters()) {
|
||||||
|
$this->stopped[$path] = $linter_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
$profiler->endServiceCall($call_id, array());
|
$profiler->endServiceCall($call_id, array());
|
||||||
throw $ex;
|
throw $ex;
|
||||||
}
|
}
|
||||||
$profiler->endServiceCall($call_id, array());
|
$profiler->endServiceCall($call_id, array());
|
||||||
if ($linter->didStopAllLinters()) {
|
|
||||||
$this->stopped[$path] = $linter_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
|
@ -356,8 +357,15 @@ abstract class ArcanistLintEngine {
|
||||||
|
|
||||||
protected function didRunLinters(array $linters) {
|
protected function didRunLinters(array $linters) {
|
||||||
assert_instances_of($linters, 'ArcanistLinter');
|
assert_instances_of($linters, 'ArcanistLinter');
|
||||||
|
|
||||||
|
$profiler = PhutilServiceProfiler::getInstance();
|
||||||
foreach ($linters as $linter) {
|
foreach ($linters as $linter) {
|
||||||
|
$call_id = $profiler->beginServiceCall(array(
|
||||||
|
'type' => 'lint',
|
||||||
|
'linter' => get_class($linter),
|
||||||
|
));
|
||||||
$linter->didRunLinters();
|
$linter->didRunLinters();
|
||||||
|
$profiler->endServiceCall($call_id, array());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue