From: Eduardo Ramos Testillano Date: Tue, 6 Oct 2015 17:41:18 +0000 (+0200) Subject: OAM and statistics specific operation X-Git-Tag: REFACTORING_TESTING_LIBRARY~99 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=d87ad4d7b6950eb6d7dc912df3a370c85d3c5a1e;p=anna.git OAM and statistics specific operation --- diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index e8ac212..fbced4a 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -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[|
:][|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; } + diff --git a/example/diameter/launcher/Launcher.hpp b/example/diameter/launcher/Launcher.hpp index 3ce4a20..8bd0093 100644 --- a/example/diameter/launcher/Launcher.hpp +++ b/example/diameter/launcher/Launcher.hpp @@ -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();