mirror of
https://we.phorge.it/source/phorge.git
synced 2025-04-11 11:58:33 +02:00
Record Conduit calls in the service profiler
Summary: This puts Conduit calls into the "Services" tab. They aren't always real service calls, but I think they're big enough to belong there and be useful. Test Plan: Viewed "Services" tab, saw conduit calls. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7482
This commit is contained in:
parent
b90e51ab0e
commit
90a9e90675
1 changed files with 19 additions and 0 deletions
|
@ -79,6 +79,25 @@ final class ConduitCall {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function execute() {
|
public function execute() {
|
||||||
|
$profiler = PhutilServiceProfiler::getInstance();
|
||||||
|
$call_id = $profiler->beginServiceCall(
|
||||||
|
array(
|
||||||
|
'type' => 'conduit',
|
||||||
|
'method' => $this->method,
|
||||||
|
));
|
||||||
|
|
||||||
|
try {
|
||||||
|
$result = $this->executeMethod();
|
||||||
|
} catch (Exception $ex) {
|
||||||
|
$profiler->endServiceCall($call_id, array());
|
||||||
|
throw $ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
$profiler->endServiceCall($call_id, array());
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function executeMethod() {
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
$user = new PhabricatorUser();
|
$user = new PhabricatorUser();
|
||||||
|
|
Loading…
Add table
Reference in a new issue