summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_url.class13
1 files changed, 11 insertions, 2 deletions
diff --git a/it_url.class b/it_url.class
index 2527d7a..1b82278 100644
--- a/it_url.class
+++ b/it_url.class
@@ -387,8 +387,11 @@ function get_multi($p=null)
curl_setopt($ch[$key], CURLOPT_URL, $url);
curl_setopt_array($ch[$key], $opts);
curl_multi_add_handle($mh, $ch[$key]);
+ $keys[$ch[$key]] = $key;
}
+ $start = microtime(true);
+
# curl_multi loop copied from example at http://php.net/manual/en/function.curl-multi-exec.php
$active = null;
do {
@@ -403,8 +406,14 @@ function get_multi($p=null)
$mrc = curl_multi_exec($mh, $active);
while (($info = curl_multi_info_read($mh)) !== false)
- if ($info['msg'] == CURLMSG_DONE && $info['result'] != CURLE_OK)
- $error[$info['handle']] = $info['result'];
+ {
+ if ($info['msg'] == CURLMSG_DONE)
+ {
+ EDC('reqtimings', $keys[$info['handle']], $info['result'], (microtime(true) - $start) * 1000);
+ if ($info['result'] != CURLE_OK)
+ $error[$info['handle']] = $info['result'];
+ }
+ }
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
}
}