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


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

Header


Content

Posted by dave on March 19, 2008 - 06:22:
Author: dave
Date: Wed Mar 19 06:22:54 2008
New Revision: 24797

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24797&view=rev
Log:
added command to control samping rate of wesnothd profiling

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=24797&r1=24796&r2=24797&view=diff
==============================================================================
--- trunk/src/server/server.cpp (original)
+++ trunk/src/server/server.cpp Wed Mar 19 06:22:54 2008
@@ -481,7 +481,7 @@
                                        continue;
                                }
 
-                               const bool sample = (sample_counter++ % 
request_sample_frequency) == 0;
+                               const bool sample = request_sample_frequency 
= 1 && (sample_counter++ % request_sample_frequency) == 0;
 
                                struct tms before_parsing, after_parsing, 
after_processing;
 
@@ -943,6 +943,13 @@
                        }
                }
                if (!kicked) out << "No user matched '" << parameters << 
"'.\n";
+       } else if(command == "sample") {
+               request_sample_frequency = atoi(parameters.c_str());
+               if(request_sample_frequency <= 0) {
+                       out << "Sampling turned off";
+               } else {
+                       out << "Sampling every " << request_sample_frequency 
<< " requests\n";
+               }
        } else if (command == "motd") {
                if (parameters == "") {
                        if (motd_ != "") {




Related Messages


Powered by MHonArc, Updated Wed Mar 19 08:41:18 2008