summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
authorChristian Schneider2012-08-30 15:41:29 +0000
committerChristian Schneider2012-08-30 15:41:29 +0000
commit81a905d013fd8cf6fff14eb8db625741c7235b34 (patch)
tree65fe639397fd4254a879fd44e901a3c72f01af30 /it_url.class
parent4c00390d2a24fdaaf38969abdae8fdceede7c3df (diff)
downloaditools-81a905d013fd8cf6fff14eb8db625741c7235b34.tar.gz
itools-81a905d013fd8cf6fff14eb8db625741c7235b34.tar.bz2
itools-81a905d013fd8cf6fff14eb8db625741c7235b34.zip
Added debug parameter reqtimings to time multiget subrequests
Diffstat (limited to 'it_url.class')
-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);
}
}