From d87ad4d7b6950eb6d7dc912df3a370c85d3c5a1e Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Tue, 6 Oct 2015 19:41:18 +0200 Subject: [PATCH] OAM and statistics specific operation --- example/diameter/launcher/Launcher.cpp | 26 +++++++++++++++++++++++--- example/diameter/launcher/Launcher.hpp | 1 + 2 files changed, 24 insertions(+), 3 deletions(-) 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(); -- 2.20.1