Virtualize Dictionary::load, implements launcher management operation: forceCountersR...
[anna.git] / example / diameter / launcher / main.cpp
index 92dd89b..44d2c06 100644 (file)
@@ -436,6 +436,7 @@ public:
   void writeBurstLogFile(const std::string &buffer) throw();
   bool burstLogEnabled() const throw() { return (((a_burstLogFile == "") || (a_burstLogFile == "null")) ? false : true); }
   void startDiameterServer(int) throw(anna::RuntimeException);
+  void forceCountersRecord() throw(anna::RuntimeException) { if (a_counterRecorderClock) a_counterRecorderClock->tick(); }
 
   anna::xml::Node* asXML(anna::xml::Node* parent) const throw();
   void resetStatistics() throw() { a_myDiameterEngine->resetStatistics(); }
@@ -846,6 +847,7 @@ std::string Launcher::help() const throw() {
   result += "\ncollect                              Reset statistics and counters to start a new test stage of";
   result += "\n                                      performance measurement. Context data is written at";
   result += "\n                                      '/var/tmp/anna.context.<pid>' by mean 'kill -10 <pid>'.";
+  result += "\nforceCountersRecord                  Forces dump to file the current counters of the process.";
   result += "\n";
   result += "\n<visibility action>|[<address>:<port>]|[socket id]";
   result += "\n";
@@ -1835,6 +1837,13 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
     return;
   }
 
+  // Counters dump on demand:
+  if(operation == "forceCountersRecord") {
+    forceCountersRecord();
+    response_content = "Current counters have been dump to disk\n";
+    return;
+  }
+
   ///////////////////////////////////////////////////////////////////
   // Tokenize operation
   Tokenizer params;
@@ -2228,14 +2237,14 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
     response_content += "' loaded.";
     response_content += "\n";
   } else if((opType == "answerxml") || (opType == "answerxml2c")) {
-    response_content += "Answer to client '";
+    response_content += "'";
     response_content += param1;
-    response_content += "' programmed.";
+    response_content += "' applied on server FIFO queue";
     response_content += "\n";
   } else if(opType == "answerxml2e") {
-    response_content += "Answer to entity '";
+    response_content += "'";
     response_content += param1;
-    response_content += "' programmed.";
+    response_content += "' applied on client FIFO queue";
     response_content += "\n";
   } else if(opType == "diameterServerSessions") {
     response_content += "Maximum server socket connections updated to '";