Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14758239
D21388.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D21388.diff
View Options
diff --git a/src/conduit/ConduitFuture.php b/src/conduit/ConduitFuture.php
--- a/src/conduit/ConduitFuture.php
+++ b/src/conduit/ConduitFuture.php
@@ -5,7 +5,6 @@
private $client;
private $engine;
private $conduitMethod;
- private $profilerCallID;
public function setClient(ConduitClient $client, $method) {
$this->client = $client;
@@ -13,29 +12,19 @@
return $this;
}
- public function isReady() {
- if ($this->profilerCallID === null) {
- $profiler = PhutilServiceProfiler::getInstance();
-
- $this->profilerCallID = $profiler->beginServiceCall(
- array(
- 'type' => 'conduit',
- 'method' => $this->conduitMethod,
- 'size' => $this->getProxiedFuture()->getHTTPRequestByteLength(),
- ));
- }
+ protected function getServiceProfilerStartParameters() {
+ return array(
+ 'type' => 'conduit',
+ 'method' => $this->conduitMethod,
+ 'size' => $this->getProxiedFuture()->getHTTPRequestByteLength(),
+ );
+ }
- return parent::isReady();
+ protected function getServiceProfilerResultParameters() {
+ return array();
}
protected function didReceiveResult($result) {
- if ($this->profilerCallID !== null) {
- $profiler = PhutilServiceProfiler::getInstance();
- $profiler->endServiceCall(
- $this->profilerCallID,
- array());
- }
-
list($status, $body, $headers) = $result;
if ($status->isError()) {
throw $status;
diff --git a/src/conduit/FutureAgent.php b/src/conduit/FutureAgent.php
--- a/src/conduit/FutureAgent.php
+++ b/src/conduit/FutureAgent.php
@@ -35,4 +35,11 @@
return $sockets;
}
+ protected function getServiceProfilerStartParameters() {
+ // At least today, the agent construct doesn't add anything interesting
+ // to the trace and the underlying futures always show up in the trace
+ // themselves.
+ return null;
+ }
+
}
diff --git a/src/future/Future.php b/src/future/Future.php
--- a/src/future/Future.php
+++ b/src/future/Future.php
@@ -115,6 +115,10 @@
$params = $this->getServiceProfilerStartParameters();
+ if ($params === null) {
+ return;
+ }
+
$profiler = PhutilServiceProfiler::getInstance();
$call_id = $profiler->beginServiceCall($params);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 23, 5:54 AM (1 h, 46 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7029917
Default Alt Text
D21388.diff (2 KB)
Attached To
Mode
D21388: Clean up some service profiler behavior in Conduit futures
Attached
Detach File
Event Timeline
Log In to Comment