Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/ssh/ConduitSSHWorkflow.php
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | public function execute(PhutilArgumentParser $args) { | ||||
$json_out = $json_out."\n"; | $json_out = $json_out."\n"; | ||||
$this->getIOChannel()->write($json_out); | $this->getIOChannel()->write($json_out); | ||||
// NOTE: Flush here so we can get an accurate result for the duration, | // NOTE: Flush here so we can get an accurate result for the duration, | ||||
// if the response is large and the receiver is slow to read it. | // if the response is large and the receiver is slow to read it. | ||||
$this->getIOChannel()->flush(); | $this->getIOChannel()->flush(); | ||||
$time_end = microtime(true); | |||||
$connection_id = idx($metadata, 'connectionID'); | $connection_id = idx($metadata, 'connectionID'); | ||||
$log = id(new PhabricatorConduitMethodCallLog()) | $log = id(new PhabricatorConduitMethodCallLog()) | ||||
->setCallerPHID($this->getSSHUser()->getPHID()) | ->setCallerPHID($this->getSSHUser()->getPHID()) | ||||
->setConnectionID($connection_id) | ->setConnectionID($connection_id) | ||||
->setMethod($method) | ->setMethod($method) | ||||
->setError((string)$error_code) | ->setError((string)$error_code) | ||||
->setDuration(1000000 * ($time_end - $time_start)) | ->setDuration(phutil_microseconds_since($time_start)) | ||||
->save(); | ->save(); | ||||
} | } | ||||
} | } |