Skip to content

Commit 2b090ad

Browse files
committed
Keep track of time taken to process requests again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@149550 13f79535-47bb-0310-9956-ffa450edef68
1 parent 2cca38d commit 2b090ad

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ Changes with Apache 2.1.3
22

33
[Remove entries to the current 2.0 section below, when backported]
44

5+
*) Start keeping track of time-taken-to-process-request again for
6+
mod_status if ExtendedStatus is enabled. [Jim Jagielski]
7+
58
*) mod_cache: Add CacheStorePrivate and CacheStoreNoStore directive.
69
[Justin Erenkrantz]
710

include/scoreboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ AP_DECLARE(int) find_child_by_pid(apr_proc_t *pid);
174174
AP_DECLARE(int) ap_update_child_status(ap_sb_handle_t *sbh, int status, request_rec *r);
175175
AP_DECLARE(int) ap_update_child_status_from_indexes(int child_num, int thread_num,
176176
int status, request_rec *r);
177-
void ap_time_process_request(int child_num, int thread_num, int status);
177+
void ap_time_process_request(ap_sb_handle_t *sbh, int status);
178178

179179
AP_DECLARE(worker_score *) ap_get_scoreboard_worker(int x, int y);
180180
AP_DECLARE(process_score *) ap_get_scoreboard_process(int x);

modules/http/http_request.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ void ap_process_request(request_rec *r)
248248
* Use this hook with extreme care and only if you know what you are
249249
* doing.
250250
*/
251+
if (ap_extended_status)
252+
ap_time_process_request(r->connection->sbh, START_PREQUEST);
251253
access_status = ap_run_quick_handler(r, 0); /* Not a look-up request */
252254
if (access_status == DECLINED) {
253255
access_status = ap_process_request_internal(r);
@@ -278,6 +280,8 @@ void ap_process_request(request_rec *r)
278280
check_pipeline_flush(r);
279281
ap_update_child_status(r->connection->sbh, SERVER_BUSY_LOG, r);
280282
ap_run_log_transaction(r);
283+
if (ap_extended_status)
284+
ap_time_process_request(r->connection->sbh, STOP_PREQUEST);
281285
}
282286

283287
static apr_table_t *rename_original_env(apr_pool_t *p, apr_table_t *t)

server/scoreboard.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,15 @@ AP_DECLARE(int) ap_update_child_status(ap_sb_handle_t *sbh, int status,
448448
status, r);
449449
}
450450

451-
void ap_time_process_request(int child_num, int thread_num, int status)
451+
void ap_time_process_request(ap_sb_handle_t *sbh, int status)
452452
{
453453
worker_score *ws;
454454

455-
if (child_num < 0) {
455+
if (sbh->child_num < 0) {
456456
return;
457457
}
458458

459-
ws = &ap_scoreboard_image->servers[child_num][thread_num];
459+
ws = &ap_scoreboard_image->servers[sbh->child_num][sbh->thread_num];
460460

461461
if (status == START_PREQUEST) {
462462
ws->start_time = apr_time_now();

0 commit comments

Comments
 (0)