mail[Wesnoth-commits] r28537 - /trunk/src/server/server.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by paniemin on August 13, 2008 - 15:58:
Author: suokko
Date: Wed Aug 13 15:02:34 2008
New Revision: 28537

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28537&view=rev
Log:
Made server automaticaly output bandwidth profiling stats to log


Modified:
    trunk/src/server/server.cpp

Modified: trunk/src/server/server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/server.cpp?rev=28537&r1=28536&r2=28537&view=diff
==============================================================================
--- trunk/src/server/server.cpp (original)
+++ trunk/src/server/server.cpp Wed Aug 13 15:02:34 2008
@@ -543,6 +543,17 @@
                                if (last_stats_ + 5*60 <= now) {
                                        dump_stats(now);
                                }
+#ifdef BANDWIDTH_MONITOR
+                               // Send network stats every hour
+                               static size_t prev_hour = 
localtime(&now)->tm_hour;
+                               if (prev_hour != localtime(&now)->tm_hour)
+                               {
+                                       prev_hour = localtime(&now)->tm_hour;
+                                       LOG_SERVER << 
network::get_bandwidth_stats();
+
+                               }
+#endif
+
                                // send a 'ping' to all players to detect 
ghosts
                                DBG_SERVER << "Pinging inactive players.\n" ;
                                std::ostringstream strstr ;




Related Messages


Powered by MHonArc, Updated Wed Aug 13 16:41:33 2008