mirror of
https://github.com/curl/curl.git
synced 2026-08-26 17:43:31 +03:00
getinfo: fix CURLINFO_QUEUE_TIME_T and add 'time_queue' var
Let CURLINFO_QUEUE_TIME_T count only the time a transfer spends queued, including possible redirect requests. Add var 'time_queue' for reporting the time in write outs. Add test for verifying correct reporting. Closes #15512
This commit is contained in:
parent
40c264db61
commit
b06b35154f
9 changed files with 25 additions and 9 deletions
|
|
@ -379,6 +379,7 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info,
|
|||
case CURLINFO_APPCONNECT_TIME_T:
|
||||
case CURLINFO_PRETRANSFER_TIME_T:
|
||||
case CURLINFO_POSTTRANSFER_TIME_T:
|
||||
case CURLINFO_QUEUE_TIME_T:
|
||||
case CURLINFO_STARTTRANSFER_TIME_T:
|
||||
case CURLINFO_REDIRECT_TIME_T:
|
||||
case CURLINFO_SPEED_DOWNLOAD_T:
|
||||
|
|
|
|||
|
|
@ -170,6 +170,8 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer,
|
|||
case TIMER_STARTOP:
|
||||
/* This is set at the start of a transfer */
|
||||
data->progress.t_startop = timestamp;
|
||||
data->progress.t_startqueue = timestamp;
|
||||
data->progress.t_postqueue = 0;
|
||||
break;
|
||||
case TIMER_STARTSINGLE:
|
||||
/* This is set at the start of each single transfer */
|
||||
|
|
@ -177,12 +179,9 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer,
|
|||
data->progress.is_t_startransfer_set = FALSE;
|
||||
break;
|
||||
case TIMER_POSTQUEUE:
|
||||
/* Set when the transfer starts (after potentially having been brought
|
||||
back from the waiting queue). It needs to count from t_startop and not
|
||||
t_startsingle since the latter is reset when a connection is brought
|
||||
back from the pending queue. */
|
||||
data->progress.t_postqueue =
|
||||
Curl_timediff_us(timestamp, data->progress.t_startop);
|
||||
/* Queue time is accumulative from all involved redirects */
|
||||
data->progress.t_postqueue +=
|
||||
Curl_timediff_us(timestamp, data->progress.t_startqueue);
|
||||
break;
|
||||
case TIMER_STARTACCEPT:
|
||||
data->progress.t_acceptdata = timestamp;
|
||||
|
|
@ -220,6 +219,7 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer,
|
|||
case TIMER_REDIRECT:
|
||||
data->progress.t_redirect = Curl_timediff_us(timestamp,
|
||||
data->progress.start);
|
||||
data->progress.t_startqueue = timestamp;
|
||||
break;
|
||||
}
|
||||
if(delta) {
|
||||
|
|
|
|||
|
|
@ -1047,6 +1047,7 @@ struct Progress {
|
|||
struct curltime start;
|
||||
struct curltime t_startsingle;
|
||||
struct curltime t_startop;
|
||||
struct curltime t_startqueue;
|
||||
struct curltime t_acceptdata;
|
||||
|
||||
#define CURR_TIME (5 + 1) /* 6 entries for 5 seconds */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue