]> granicus.if.org Git - apache/commitdiff
More mod_status work... Get Current Time, Restart Time and Server uptime
authorBill Stoddard <stoddard@apache.org>
Sun, 4 Feb 2001 03:12:49 +0000 (03:12 +0000)
committerBill Stoddard <stoddard@apache.org>
Sun, 4 Feb 2001 03:12:49 +0000 (03:12 +0000)
displaying properly.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87972 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_status.c
server/mpm/beos/beos.c
server/mpm/mpmt_beos/mpmt_beos.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/prefork/prefork.c
server/mpm/spmt_os2/spmt_os2.c
server/mpm/winnt/mpm_winnt.c

index 989076f12467dcd08457afc08f636cf824f796f5..bb685505972569ec20a302302dbaa57b0a721441 100644 (file)
@@ -177,9 +177,12 @@ static void format_kbyte_out(request_rec *r, unsigned long kbytes)
        ap_rprintf(r, "%.1f GB", (float) kbytes / MBYTE);
 }
 
-static void show_time(request_rec *r, time_t tsecs)
+static void show_time(request_rec *r, apr_time_t tsecs) 
 {
     long days, hrs, mins, secs;
+    
+    /* convert apr_time_t (in micro seconds) to seconds */
+    tsecs = tsecs/1000000;
 
     secs = tsecs % 60;
     tsecs /= 60;
@@ -225,7 +228,7 @@ static char status_flags[SERVER_NUM_STATUS];
 static int status_handler(request_rec *r)
 {
     const char *loc;
-    time_t nowtime = time(NULL);
+    apr_time_t nowtime = apr_now();
     time_t up_time;
     int j, i, res;
     int ready = 0;
index ba6e9e1d0dfd347c9cf157d793bd88b2cfb4f28a..761e5ab14ac215939422df7d3f2b3f09e705127b 100644 (file)
@@ -97,7 +97,7 @@ static int ap_threads_to_start=0;
 static int min_spare_threads=0;
 static int max_spare_threads=0;
 static int ap_thread_limit=0;
-static time_t ap_restart_time=0;
+static apr_time_t ap_restart_time=0;
 AP_DECLARE_DATA int ap_extended_status = 0;
 static int num_listening_sockets = 0; /* set by open_listeners in ap_mpm_run */
 static apr_socket_t ** listening_sockets;
@@ -797,7 +797,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
     }
     
     if (!is_graceful) {
-        ap_restart_time = time(NULL); 
+        ap_restart_time = apr_now();
     }
 
     /* just before we go, tidy up the locks we've created to prevent a 
index 9d41c2ac8eb243e7bf0a18348a2e60dfc1fff803..616cdb7d5686dd2dd6be5cb00cb000b9bac61a5c 100644 (file)
@@ -91,7 +91,7 @@ static int ap_daemons_to_start=0;
 static int min_spare_threads=0;
 static int max_spare_threads=0;
 static int ap_daemons_limit=0;
-static time_t ap_restart_time=0;
+static apr_time_t ap_restart_time=0;
 AP_DECLARE_DATA int ap_extended_status = 0;
 static int workers_may_exit = 0;
 static int requests_this_child;
@@ -809,7 +809,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
                    "SIGHUP received.  Attempting to restart");
     }
     if (!is_graceful) {
-        ap_restart_time = time(NULL); 
+        ap_restart_time = apr_now();
     }
     delete_port(port_of_death);
     return 0;
index 6d5032b43792c4a8a61041f5d0da7d8a92669dba..368cb1b46785df32617358f267aa04c7f0c4ab04 100644 (file)
@@ -1148,7 +1148,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
                    "SIGHUP received.  Attempting to restart");
     }
     if (!is_graceful) {
-        ap_restart_time = time(NULL); 
+        ap_restart_time = apr_now();
     }
     return 0;
 }
index 63e4d97a9e665fac5496ad3f1b1d00f972c254b1..ef826cdd9b4cc07a3c656d47fdd5684f0653382b 100644 (file)
@@ -1283,7 +1283,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
     }
 
     if (!is_graceful) {
-       ap_restart_time = time(NULL);
+       ap_restart_time = apr_now();
     }
 
     return 0;
index d22f02a7355375b0c8e8482d6246b970ec2ff0e2..f8a2983e2f5a04b97b2a8bf308782c3db1759fea 100644 (file)
@@ -90,7 +90,7 @@ static int ap_daemons_to_start=0;
 static int ap_daemons_min_free=0;
 static int ap_daemons_max_free=0;
 static int ap_daemons_limit=0;
-static time_t ap_restart_time=0;
+static apr_time_t ap_restart_time=0;
 static int ap_extended_status = 0;
 
 /*
@@ -1358,7 +1358,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
     }
 
     if (!is_graceful) {
-       ap_restart_time = time(NULL);
+       ap_restart_time = apr_now();
     }
 
     return 0;
index 8e135ebc9819286c9894211f76471efed6ed945d..9773fb2c2adbdd3b840c2ca84d7651d3def02be0 100644 (file)
@@ -1240,7 +1240,7 @@ static void child_main()
     /* Set up the scoreboard. The scoreboard in this MPM only applies to the
      * child process and is not shared across processes
      */
-    ap_restart_time = time(NULL);
+    ap_restart_time = apr_now();
     ap_create_scoreboard(pconf, SB_NOT_SHARED);
 
     /* This is the child process or we are running in single process