diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-07-30 19:29:18 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-07-30 19:29:18 +0000 |
commit | aeb6f60a430b864f1aa7032cb2ce4411b82a9296 (patch) | |
tree | 08d1b2a1f6e0b6601d0e880255de215342597d4e /src/modules | |
parent | 2bc7de2e3fb586bf47feabe95eb56b4dc069b655 (diff) |
Add uptime
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7631 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_httpd_stats.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index d685d5c63..4139d7a20 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -6,7 +6,7 @@ * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see - * the file COPYING for details. + * the file COPYING for details. * * --------------------------------------------------- */ @@ -110,6 +110,15 @@ class ModuleHttpStats : public Module data << "<opercount>" << ServerInstance->all_opers.size() << "</opercount>"; data << "<socketcount>" << (ServerInstance->SE->GetMaxFds() - ServerInstance->SE->GetRemainingFds()) << "</socketcount><socketmax>" << ServerInstance->SE->GetMaxFds() << "</socketmax><socketengine>" << ServerInstance->SE->GetName() << "</socketengine>"; + + time_t current_time = 0; + current_time = ServerInstance->Time(); + time_t server_uptime = current_time - ServerInstance->startup_time; + struct tm* stime; + stime = gmtime(&server_uptime); + data << "<uptime><days>" << stime->tm_yday << "</days><hours>" << stime->tm_hour << "</hours><mins>" << stime->tm_min << "</mins><secs>" << stime->tm_sec << "</secs></uptime>"; + + data << "</general>"; data << "<modulelist>"; for (int i = 0; i <= ServerInstance->GetModuleCount(); i++) |