Investigate latency of exec
This commit is contained in:
parent
1f4529d4e4
commit
28dece1adf
1 changed files with 7 additions and 0 deletions
|
@ -472,6 +472,7 @@ class FunctionsV1
|
||||||
);
|
);
|
||||||
$body = json_encode($body);
|
$body = json_encode($body);
|
||||||
|
|
||||||
|
$createExecStart = microtime(true);
|
||||||
\curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
|
\curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
|
||||||
|
|
||||||
$headers = [
|
$headers = [
|
||||||
|
@ -491,11 +492,14 @@ class FunctionsV1
|
||||||
|
|
||||||
\curl_close($ch);
|
\curl_close($ch);
|
||||||
|
|
||||||
|
$createExecTime = microtime(true)- $createExecStart;
|
||||||
|
var_dump($createExecTime);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start execution without detatching - will receive stdout/stderr as response
|
* Start execution without detatching - will receive stdout/stderr as response
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$startExecStart = microtime(true);
|
||||||
$ch = \curl_init();
|
$ch = \curl_init();
|
||||||
$URL = "http://localhost/exec/{$execId}/start";
|
$URL = "http://localhost/exec/{$execId}/start";
|
||||||
\curl_setopt($ch, CURLOPT_URL, $URL);
|
\curl_setopt($ch, CURLOPT_URL, $URL);
|
||||||
|
@ -513,11 +517,14 @@ class FunctionsV1
|
||||||
$result = \curl_exec($ch);
|
$result = \curl_exec($ch);
|
||||||
var_dump($result);
|
var_dump($result);
|
||||||
|
|
||||||
|
|
||||||
if (\curl_errno($ch)) {
|
if (\curl_errno($ch)) {
|
||||||
echo 'Error:' . \curl_error($ch);
|
echo 'Error:' . \curl_error($ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
\curl_close($ch);
|
\curl_close($ch);
|
||||||
|
$startExecTime = microtime(true)- $startExecStart;
|
||||||
|
var_dump($startExecTime);
|
||||||
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue