@@ -66,16 +66,21 @@ public function get($manager, $method, $params = [])
6666 curl_setopt ($ ch , CURLOPT_CONNECTTIMEOUT , self ::CONNECT_TIMEOUT );
6767 curl_setopt ($ ch , CURLOPT_TIMEOUT , self ::TIMEOUT );
6868
69+ $ startTime = microtime (true );
6970 $ json = curl_exec ($ ch );
71+ $ endTime = microtime (true );
7072 curl_close ($ ch );
7173
72- Logger::debug ('perun.RPC: GET call $uri with params: ' . $ paramsQuery . ', response: ' . $ json );
74+ $ responseTime = round ($ endTime - $ startTime , 3 );
75+ Logger::debug ('perun.RPC: GET call ' . $ uri . ' with params: ' . $ paramsQuery . ', response : ' .
76+ $ json . ' in: ' . $ responseTime . 's. ' );
7377
7478 $ result = json_decode ($ json , true );
7579
7680 if (json_last_error () !== JSON_ERROR_NONE ) {
7781 throw new Exception (
78- 'Cant \'t decode response from Perun. Call: $uri, Params: $paramsQuery, Response: $json '
82+ 'Cant \'t decode response from Perun. Call: ' . $ uri . ', Params: ' . $ paramsQuery .
83+ ', Response: ' . $ json
7984 );
8085 }
8186 if (isset ($ result ['errorId ' ])) {
@@ -107,17 +112,22 @@ public function post($manager, $method, $params = [])
107112 curl_setopt ($ ch , CURLOPT_CONNECTTIMEOUT , self ::CONNECT_TIMEOUT );
108113 curl_setopt ($ ch , CURLOPT_TIMEOUT , self ::TIMEOUT );
109114
115+ $ startTime = microtime (true );
110116 $ json = curl_exec ($ ch );
117+ $ endTime = microtime (true );
111118 curl_close ($ ch );
112119
113- Logger::debug ('perun.RPC: POST call $uri with params: ' . $ paramsJson . ', response: ' . $ json );
120+ $ responseTime = round ($ endTime - $ startTime , 3 );
121+ Logger::debug ('perun.RPC: POST call ' . $ uri . ' with params: ' . $ paramsJson . ', response : ' .
122+ $ json . ' in: ' . $ responseTime . 's. ' );
114123
115124 $ result = json_decode ($ json , true );
116125
117126
118127 if (json_last_error () !== JSON_ERROR_NONE ) {
119128 throw new Exception (
120- 'Cant \'t decode response from Perun. Call: $uri, Params: $paramsJson, Response: $json '
129+ 'Cant \'t decode response from Perun. Call: ' . $ uri . ', Params: ' . $ paramsJson .
130+ ', Response: ' . $ json
121131 );
122132 }
123133 if (isset ($ result ['errorId ' ])) {
0 commit comments