OAM and statistics specific operation
authorEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Tue, 6 Oct 2015 17:41:18 +0000 (19:41 +0200)
committerEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Tue, 6 Oct 2015 17:41:18 +0000 (19:41 +0200)
example/diameter/launcher/Launcher.cpp
example/diameter/launcher/Launcher.hpp

index e8ac212..fbced4a 100644 (file)
@@ -988,6 +988,8 @@ std::string Launcher::help() const throw() {
   result += "\n                                     This operation applies over all the registered realm nodes";
   result += "\n                                      except if one specific working node has been set.";
   result += "\nforceCountersRecord                  Forces dump to file the current counters of the process.";
+  result += "\noam-and-stats                        Dumps current counters and statistics of the process. This is";
+  result += "\n                                      also done at process context dump.";
   result += "\n";
   result += "\n<visibility action>[|<address>:<port>][|socket id]";
   result += "\n";
@@ -1438,6 +1440,13 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
     return;
   }
 
+  // OAM & statistics:
+  if(operation == "oam-and-stats") {
+    anna::xml::Node root("root");
+    response_content = anna::xml::Compiler().apply(oamAndStatsAsXML(&root));
+    return;
+  }
+
   ///////////////////////////////////////////////////////////////////
   // Tokenize operation
   Tokenizer params;
@@ -2119,6 +2128,19 @@ throw() {
     it->second->asXML(result);
   }
 
+  // OAM & statistics:
+  oamAndStatsAsXML(result);
+
+  // Testing: could be heavy if test case reports are enabled
+  TestManager::instantiate().asXML(result);
+
+  return result;
+}
+
+anna::xml::Node* Launcher::oamAndStatsAsXML(anna::xml::Node* parent) const
+throw() {
+  anna::xml::Node* result = parent->createChild("OamAndStatistics");
+
   // OAM:
   anna::diameter::comm::OamModule::instantiate().asXML(result);
   anna::diameter::comm::ApplicationMessageOamModule::instantiate().asXML(result);
@@ -2126,8 +2148,6 @@ throw() {
   // Statistics:
   anna::statistics::Engine::instantiate().asXML(result);
 
-  // Testing: could be heavy if test case reports are enabled
-  TestManager::instantiate().asXML(result);
-
   return result;
 }
+
index 3ce4a20..8bd0093 100644 (file)
@@ -112,6 +112,7 @@ public:
   void resetCounters() throw();
   void signalUSR2() throw(anna::RuntimeException);
   std::string help() const throw();
+  anna::xml::Node* oamAndStatsAsXML(anna::xml::Node* parent) const throw();
 
   // helpers
   bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw();