From: Eduardo Ramos Testillano Date: Thu, 8 Oct 2015 00:23:41 +0000 (+0200) Subject: Separate oam and statistics in event operations X-Git-Tag: REFACTORING_TESTING_LIBRARY~93 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=56afb5fb4f4985e5529e7491b78a6214e455f95a;p=anna.git Separate oam and statistics in event operations --- diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index c582cf4..4ec6ea0 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -989,8 +989,10 @@ 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 += "\nshow-oam Dumps current counters of the process. This is also done at"; + result += "\n process context dump."; + result += "\nshow-stats Dumps statistics of the process. This is also done at process"; + result += "\n context dump."; result += "\n"; result += "\n[|
:][|socket id]"; result += "\n"; @@ -1442,9 +1444,14 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons } // OAM & statistics: - if(operation == "oam-and-stats") { + if(operation == "show-oam") { anna::xml::Node root("root"); - response_content = anna::xml::Compiler().apply(oamAndStatsAsXML(&root)); + response_content = anna::xml::Compiler().apply(oamAsXML(&root)); + return; + } + if(operation == "show-stats") { + anna::xml::Node root("root"); + response_content = anna::xml::Compiler().apply(statsAsXML(&root)); return; } @@ -2130,7 +2137,8 @@ throw() { } // OAM & statistics: - oamAndStatsAsXML(result); + oamAsXML(result); + statsAsXML(result); // Testing: could be heavy if test case reports are enabled TestManager::instantiate().asXML(result); @@ -2138,17 +2146,24 @@ throw() { return result; } -anna::xml::Node* Launcher::oamAndStatsAsXML(anna::xml::Node* parent) const +anna::xml::Node* Launcher::oamAsXML(anna::xml::Node* parent) const throw() { - anna::xml::Node* result = parent->createChild("OamAndStatistics"); + anna::xml::Node* result = parent->createChild("Oam"); // OAM: anna::diameter::comm::OamModule::instantiate().asXML(result); anna::diameter::comm::ApplicationMessageOamModule::instantiate().asXML(result); anna::diameter::codec::OamModule::instantiate().asXML(result); + + return result; +} + +anna::xml::Node* Launcher::statsAsXML(anna::xml::Node* parent) const +throw() { + anna::xml::Node* result = parent->createChild("Statistics"); + // Statistics: anna::statistics::Engine::instantiate().asXML(result); return result; } - diff --git a/example/diameter/launcher/Launcher.hpp b/example/diameter/launcher/Launcher.hpp index 8bd0093..2101948 100644 --- a/example/diameter/launcher/Launcher.hpp +++ b/example/diameter/launcher/Launcher.hpp @@ -112,7 +112,8 @@ public: void resetCounters() throw(); void signalUSR2() throw(anna::RuntimeException); std::string help() const throw(); - anna::xml::Node* oamAndStatsAsXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* oamAsXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* statsAsXML(anna::xml::Node* parent) const throw(); // helpers bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw();