diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-30 19:56:10 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-30 19:56:10 +0000 |
commit | 8933b795003f8ad202fce6e553191be8932a37b6 (patch) | |
tree | bfb460cbf9261b44deabfd469046a14a95c8d16c /src/server/server.cc | |
parent | f71901eeab126bb4b7e2552dd2edf0b34632c683 (diff) |
zlib support
Diffstat (limited to 'src/server/server.cc')
-rw-r--r-- | src/server/server.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/server/server.cc b/src/server/server.cc index ee54352..27cdf9b 100644 --- a/src/server/server.cc +++ b/src/server/server.cc @@ -100,10 +100,19 @@ void Server::shutdown() { con_print << "Shutting down server..." << std::endl; - con_debug << "Network statistics:" << std::endl; - con_debug << " bytes sent " << std::setw(6) << core::Stats::network_bytes_sent / 1024 << " Kb" << std::endl; - con_debug << " bytes received " << std::setw(6) << core::Stats::network_bytes_received / 1024 << " Kb" << std::endl; + float ratio = 0; + if (core::Stats::network_uncompressed_bytes_sent > 0) + ratio = 100.0f - floorf((float)core::Stats::network_bytes_sent / + (float) core::Stats::network_uncompressed_bytes_sent * 100.0f); + + int minutes = (int) floorf(time() / 60.0f); + int seconds = (int) floorf(time() - (float) minutes* 60.0f); + con_debug << "Statistics:" << std::endl; + con_debug << " uptime " << std::setfill(' ') << std::setw(3) << minutes << ":" << std::setfill('0') << std::setw(2) << seconds << std::endl; + con_debug << " bytes sent " << std::setfill(' ') << std::setw(6) << core::Stats::network_bytes_sent / 1024 << " Kb" << std::endl; + con_debug << " bytes received " << std::setw(6) << core::Stats::network_bytes_received / 1024 << " Kb" << std::endl; + con_debug << " compression " << std::setw(6) << ratio << " %" << std::endl; Console::shutdown(); core::Application::shutdown(); |