Lines 221-226
Link Here
|
221 |
} connect_state_e; |
221 |
} connect_state_e; |
222 |
|
222 |
|
223 |
#define CBUFFSIZE (8192) |
223 |
#define CBUFFSIZE (8192) |
|
|
224 |
#define RESPCODESIZE (4) /* 3 digits and null */ |
224 |
|
225 |
|
225 |
struct connection { |
226 |
struct connection { |
226 |
apr_pool_t *ctx; |
227 |
apr_pool_t *ctx; |
Lines 242-247
Link Here
|
242 |
endwrite, /* Request written */ |
243 |
endwrite, /* Request written */ |
243 |
beginread, /* First byte of input */ |
244 |
beginread, /* First byte of input */ |
244 |
done; /* Connection closed */ |
245 |
done; /* Connection closed */ |
|
|
246 |
char respcode[RESPCODESIZE];/* HTTP response code */ |
245 |
|
247 |
|
246 |
int socknum; |
248 |
int socknum; |
247 |
#ifdef USE_SSL |
249 |
#ifdef USE_SSL |
Lines 254-259
Link Here
|
254 |
apr_interval_time_t waittime; /* between request and reading response */ |
256 |
apr_interval_time_t waittime; /* between request and reading response */ |
255 |
apr_interval_time_t ctime; /* time to connect */ |
257 |
apr_interval_time_t ctime; /* time to connect */ |
256 |
apr_interval_time_t time; /* time for connection */ |
258 |
apr_interval_time_t time; /* time for connection */ |
|
|
259 |
char respcode[RESPCODESIZE]; /* HTTP response code */ |
257 |
}; |
260 |
}; |
258 |
|
261 |
|
259 |
#define ap_min(a,b) (((a)<(b))?(a):(b)) |
262 |
#define ap_min(a,b) (((a)<(b))?(a):(b)) |
Lines 1057-1073
Link Here
|
1057 |
perror("Cannot open gnuplot output file"); |
1060 |
perror("Cannot open gnuplot output file"); |
1058 |
exit(1); |
1061 |
exit(1); |
1059 |
} |
1062 |
} |
1060 |
fprintf(out, "starttime\tseconds\tctime\tdtime\tttime\twait\n"); |
1063 |
fprintf(out, "starttime\tseconds\tctime\tdtime\tttime\twait\trespcode\n"); |
1061 |
for (i = 0; i < done; i++) { |
1064 |
for (i = 0; i < done; i++) { |
1062 |
(void) apr_ctime(tmstring, stats[i].starttime); |
1065 |
(void) apr_ctime(tmstring, stats[i].starttime); |
1063 |
fprintf(out, "%s\t%" APR_TIME_T_FMT "\t%" APR_TIME_T_FMT |
1066 |
fprintf(out, "%s\t%" APR_TIME_T_FMT "\t%" APR_TIME_T_FMT |
1064 |
"\t%" APR_TIME_T_FMT "\t%" APR_TIME_T_FMT |
1067 |
"\t%" APR_TIME_T_FMT "\t%" APR_TIME_T_FMT |
1065 |
"\t%" APR_TIME_T_FMT "\n", tmstring, |
1068 |
"\t%" APR_TIME_T_FMT "\t%s\n", tmstring, |
1066 |
apr_time_sec(stats[i].starttime), |
1069 |
apr_time_sec(stats[i].starttime), |
1067 |
ap_round_ms(stats[i].ctime), |
1070 |
ap_round_ms(stats[i].ctime), |
1068 |
ap_round_ms(stats[i].time - stats[i].ctime), |
1071 |
ap_round_ms(stats[i].time - stats[i].ctime), |
1069 |
ap_round_ms(stats[i].time), |
1072 |
ap_round_ms(stats[i].time), |
1070 |
ap_round_ms(stats[i].waittime)); |
1073 |
ap_round_ms(stats[i].waittime), |
|
|
1074 |
stats[i].respcode); |
1071 |
} |
1075 |
} |
1072 |
fclose(out); |
1076 |
fclose(out); |
1073 |
} |
1077 |
} |
Lines 1356-1361
Link Here
|
1356 |
s->ctime = ap_max(0, c->connect - c->start); |
1360 |
s->ctime = ap_max(0, c->connect - c->start); |
1357 |
s->time = ap_max(0, c->done - c->start); |
1361 |
s->time = ap_max(0, c->done - c->start); |
1358 |
s->waittime = ap_max(0, c->beginread - c->endwrite); |
1362 |
s->waittime = ap_max(0, c->beginread - c->endwrite); |
|
|
1363 |
strncpy(s->respcode, c->respcode, RESPCODESIZE); |
1359 |
if (heartbeatres && !(done % heartbeatres)) { |
1364 |
if (heartbeatres && !(done % heartbeatres)) { |
1360 |
fprintf(stderr, "Completed %d requests\n", done); |
1365 |
fprintf(stderr, "Completed %d requests\n", done); |
1361 |
fflush(stderr); |
1366 |
fflush(stderr); |
Lines 1387-1393
Link Here
|
1387 |
apr_size_t r; |
1392 |
apr_size_t r; |
1388 |
apr_status_t status; |
1393 |
apr_status_t status; |
1389 |
char *part; |
1394 |
char *part; |
1390 |
char respcode[4]; /* 3 digits and null */ |
1395 |
char respcode[RESPCODESIZE]; |
1391 |
|
1396 |
|
1392 |
r = sizeof(buffer); |
1397 |
r = sizeof(buffer); |
1393 |
#ifdef USE_SSL |
1398 |
#ifdef USE_SSL |
Lines 1542-1547
Link Here
|
1542 |
else { |
1547 |
else { |
1543 |
strcpy(respcode, "500"); |
1548 |
strcpy(respcode, "500"); |
1544 |
} |
1549 |
} |
|
|
1550 |
strncpy(c->respcode, respcode, RESPCODESIZE); |
1545 |
|
1551 |
|
1546 |
if (respcode[0] != '2') { |
1552 |
if (respcode[0] != '2') { |
1547 |
err_response++; |
1553 |
err_response++; |
Lines 1602-1607
Link Here
|
1602 |
s->ctime = ap_max(0, c->connect - c->start); |
1608 |
s->ctime = ap_max(0, c->connect - c->start); |
1603 |
s->time = ap_max(0, c->done - c->start); |
1609 |
s->time = ap_max(0, c->done - c->start); |
1604 |
s->waittime = ap_max(0, c->beginread - c->endwrite); |
1610 |
s->waittime = ap_max(0, c->beginread - c->endwrite); |
|
|
1611 |
strncpy(s->respcode, c->respcode, RESPCODESIZE); |
1605 |
if (heartbeatres && !(done % heartbeatres)) { |
1612 |
if (heartbeatres && !(done % heartbeatres)) { |
1606 |
fprintf(stderr, "Completed %d requests\n", done); |
1613 |
fprintf(stderr, "Completed %d requests\n", done); |
1607 |
fflush(stderr); |
1614 |
fflush(stderr); |