mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Should consider APRizing the entire module. For now, use HAVE_TIMES
to indicate if we have the necessary structures. This is part of getting mod_status working on Windows git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87958 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -237,7 +237,7 @@ static int status_handler(request_rec *r)
|
|||||||
unsigned long bcount = 0;
|
unsigned long bcount = 0;
|
||||||
unsigned long kbcount = 0;
|
unsigned long kbcount = 0;
|
||||||
long req_time;
|
long req_time;
|
||||||
#ifndef NO_TIMES
|
#ifdef HAVE_TIMES
|
||||||
#ifdef _SC_CLK_TCK
|
#ifdef _SC_CLK_TCK
|
||||||
float tick = sysconf(_SC_CLK_TCK);
|
float tick = sysconf(_SC_CLK_TCK);
|
||||||
#else
|
#else
|
||||||
@@ -326,12 +326,12 @@ static int status_handler(request_rec *r)
|
|||||||
lres = score_record.access_count;
|
lres = score_record.access_count;
|
||||||
bytes = score_record.bytes_served;
|
bytes = score_record.bytes_served;
|
||||||
if (lres != 0 || (res != SERVER_READY && res != SERVER_DEAD)) {
|
if (lres != 0 || (res != SERVER_READY && res != SERVER_DEAD)) {
|
||||||
#ifndef NO_TIMES
|
#ifdef HAVE_TIMES
|
||||||
tu += score_record.times.tms_utime;
|
tu += score_record.times.tms_utime;
|
||||||
ts += score_record.times.tms_stime;
|
ts += score_record.times.tms_stime;
|
||||||
tcu += score_record.times.tms_cutime;
|
tcu += score_record.times.tms_cutime;
|
||||||
tcs += score_record.times.tms_cstime;
|
tcs += score_record.times.tms_cstime;
|
||||||
#endif /* NO_TIMES */
|
#endif /* HAVE_TIMES */
|
||||||
count += lres;
|
count += lres;
|
||||||
bcount += bytes;
|
bcount += bytes;
|
||||||
if (bcount >= KBYTE) {
|
if (bcount >= KBYTE) {
|
||||||
@@ -371,7 +371,7 @@ static int status_handler(request_rec *r)
|
|||||||
ap_rprintf(r, "Total Accesses: %lu\nTotal kBytes: %lu\n",
|
ap_rprintf(r, "Total Accesses: %lu\nTotal kBytes: %lu\n",
|
||||||
count, kbcount);
|
count, kbcount);
|
||||||
|
|
||||||
#ifndef NO_TIMES
|
#ifdef HAVE_TIMES
|
||||||
/* Allow for OS/2 not having CPU stats */
|
/* Allow for OS/2 not having CPU stats */
|
||||||
if (ts || tu || tcu || tcs)
|
if (ts || tu || tcu || tcs)
|
||||||
ap_rprintf(r, "CPULoad: %g\n",
|
ap_rprintf(r, "CPULoad: %g\n",
|
||||||
@@ -395,7 +395,7 @@ static int status_handler(request_rec *r)
|
|||||||
ap_rprintf(r, "Total accesses: %lu - Total Traffic: ", count);
|
ap_rprintf(r, "Total accesses: %lu - Total Traffic: ", count);
|
||||||
format_kbyte_out(r, kbcount);
|
format_kbyte_out(r, kbcount);
|
||||||
|
|
||||||
#ifndef NO_TIMES
|
#ifdef HAVE_TIMES
|
||||||
/* Allow for OS/2 not having CPU stats */
|
/* Allow for OS/2 not having CPU stats */
|
||||||
ap_rputs("<br>\n", r);
|
ap_rputs("<br>\n", r);
|
||||||
ap_rprintf(r, "CPU Usage: u%g s%g cu%g cs%g",
|
ap_rprintf(r, "CPU Usage: u%g s%g cu%g cs%g",
|
||||||
@@ -493,7 +493,7 @@ static int status_handler(request_rec *r)
|
|||||||
if (no_table_report)
|
if (no_table_report)
|
||||||
ap_rputs("<p><hr><h2>Server Details</h2>\n\n", r);
|
ap_rputs("<p><hr><h2>Server Details</h2>\n\n", r);
|
||||||
else
|
else
|
||||||
#ifdef NO_TIMES
|
#ifndef HAVE_TIMES
|
||||||
/* Allow for OS/2 not having CPU stats */
|
/* Allow for OS/2 not having CPU stats */
|
||||||
ap_rputs("<p>\n\n<table border=0><tr><th>Srv<th>PID<th>Acc<th>M\n<th>SS<th>Req<th>Conn<th>Child<th>Slot<th>Client<th>VHost<th>Request</tr>\n\n", r);
|
ap_rputs("<p>\n\n<table border=0><tr><th>Srv<th>PID<th>Acc<th>M\n<th>SS<th>Req<th>Conn<th>Child<th>Slot<th>Client<th>VHost<th>Request</tr>\n\n", r);
|
||||||
#else
|
#else
|
||||||
@@ -510,17 +510,18 @@ static int status_handler(request_rec *r)
|
|||||||
vhost = NULL;
|
vhost = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(NO_GETTIMEOFDAY)
|
#if defined(NO_GETTIMEOFDAY)
|
||||||
#ifndef NO_TIMES
|
#ifdef HAVE_TIMES
|
||||||
if (score_record.start_time == (clock_t) 0)
|
if (score_record.start_time == (clock_t) 0)
|
||||||
#endif /* NO_TIMES */
|
#endif /* HAVE_TIMES */
|
||||||
req_time = 0L;
|
req_time = 0L;
|
||||||
#ifndef NO_TIMES
|
#ifdef HAVE_TIMES
|
||||||
else {
|
else {
|
||||||
req_time = score_record.stop_time - score_record.start_time;
|
req_time = score_record.stop_time - score_record.start_time;
|
||||||
req_time = (req_time * 1000) / (int) tick;
|
req_time = (req_time * 1000) / (int) tick;
|
||||||
}
|
}
|
||||||
#endif /* NO_TIMES */
|
#endif /* HAVE_TIMES */
|
||||||
#else
|
#else
|
||||||
if (score_record.start_time == 0L &&
|
if (score_record.start_time == 0L &&
|
||||||
score_record.start_time == 0L)
|
score_record.start_time == 0L)
|
||||||
@@ -587,7 +588,7 @@ static int status_handler(request_rec *r)
|
|||||||
ap_rputs("?STATE?", r);
|
ap_rputs("?STATE?", r);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef NO_TIMES
|
#ifndef HAVE_TIMES
|
||||||
/* Allow for OS/2 not having CPU stats */
|
/* Allow for OS/2 not having CPU stats */
|
||||||
ap_rprintf(r, "]\n %.0f %ld (",
|
ap_rprintf(r, "]\n %.0f %ld (",
|
||||||
#else
|
#else
|
||||||
@@ -661,7 +662,7 @@ static int status_handler(request_rec *r)
|
|||||||
ap_rputs("<td>?", r);
|
ap_rputs("<td>?", r);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef NO_TIMES
|
#ifndef HAVE_TIMES
|
||||||
/* Allow for OS/2 not having CPU stats */
|
/* Allow for OS/2 not having CPU stats */
|
||||||
ap_rprintf(r, "\n<td>%.0f<td>%ld",
|
ap_rprintf(r, "\n<td>%.0f<td>%ld",
|
||||||
#else
|
#else
|
||||||
@@ -697,7 +698,7 @@ static int status_handler(request_rec *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(short_report || no_table_report)) {
|
if (!(short_report || no_table_report)) {
|
||||||
#ifdef NO_TIMES
|
#ifndef HAVE_TIMES
|
||||||
ap_rputs("</table>\n \
|
ap_rputs("</table>\n \
|
||||||
<hr> \
|
<hr> \
|
||||||
<table>\n \
|
<table>\n \
|
||||||
|
Reference in New Issue
Block a user