1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

Investigate latency of exec

This commit is contained in:
kodumbeats 2021-03-31 15:41:35 -04:00
parent 1f4529d4e4
commit 28dece1adf

View file

@ -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);