X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FLauncher.cpp;h=8ea7511c6e9337dc27b57f68b01b99e21000cdbd;hb=daeeaacceeccefcac46838f460b19409cc5c4cb4;hp=c582cf473b75880226c4a12c5aa28a716b0b5736;hpb=3dde4250ae27629bc4a633bc76472ac8519201ef;p=anna.git diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index c582cf4..8ea7511 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -174,6 +174,11 @@ void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool eventOp dictionary = (*it)->getAttribute("dictionary"); id_value = id->getIntegerValue(); + if (stackEngine.getDictionary(id_value)) { // Ignore (but don't fail) dictionary load with same stack id already registered + LOGWARNING(anna::Logger::warning(anna::functions::asString("Ignore dictionary load for stack id already registered: %llu", id_value), ANNA_FILE_LOCATION)); + continue; + } + try { d = stackEngine.createDictionary(id_value, dictionary->getValue()); LOGDEBUG(anna::Logger::debug(anna::functions::asString("Created dictionary (%p) for stack id %llu", d, id_value), ANNA_FILE_LOCATION)); @@ -989,8 +994,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"; @@ -1308,13 +1315,18 @@ std::string Launcher::help() const throw() { result += "\n"; result += "\n Provide 0 in order to stop the timer triggering."; result += "\n"; - result += "\n There timer manager resolution currently harcoded allows a maximum of "; + result += "\n The timer manager resolution currently harcoded allows a maximum of "; result += anna::functions::asString(1000/a_admlMinResolution); result += " events"; result += "\n per second. To reach greater rates ADML will join synchronously the needed number of"; result += "\n new time-triggered test cases per a single event, writting a warning-level trace to"; result += "\n advice about the risk of burst sendings and recommend launching multiple instances"; result += "\n to achieve such load with a lower rate per instance."; result += "\n"; + result += "\n test|next[|] Forces the execution of the next test case(s) without waiting for test manager tick."; + result += "\n Provide an integer value for 'sync-amount' to send a burst synchronous amount of the"; + result += "\n next programmed test cases (1 by default). This event works regardless the timer tick"; + result += "\n function, but it is normally used with the test manager tick stopped."; + result += "\n"; result += "\n test|ip-limit[|amount] In-progress limit of test cases. No new test cases will be launched over this value"; result += "\n (test Manager tick work will be ignored). Zero-value is equivalent to stop the clock."; result += "\n tick, -1 is used to specify 'no limit' which is the default. If missing amount, the"; @@ -1442,9 +1454,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(oamAsXML(&root)); + return; + } + if(operation == "show-stats") { anna::xml::Node root("root"); - response_content = anna::xml::Compiler().apply(oamAndStatsAsXML(&root)); + response_content = anna::xml::Compiler().apply(statsAsXML(&root)); return; } @@ -1750,6 +1767,7 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons } else if((opType == "test")) { // test||[|parameters] Add a new step to the test case ... // test|ttps| Starts/resume the provided number of time ticks per second (ttps). The ADML starts ... + // test|next[|] Forces the execution of the next test case(s) without waiting for test manager tick ... // test|ip-limit[|amount] In-progress limit of test cases. No new test cases will be launched over this value ... // test|repeats| Restarts the whole programmed test list when finished the amount number of times ... // test|report[|[yes]|no] Every time a test case is finished a report file in xml format will be created under ... @@ -1776,6 +1794,22 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons opt_response_content += "unable to configure the test rate provided"; } } + else if (param1 == "next") { + if (numParams > 2) + throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION); + + int sync_amount = ((param2 != "") ? atoi(param2.c_str()) : 1); + + if (sync_amount < 1) + throw anna::RuntimeException("The parameter 'sync-amount' must be a positive integer value", ANNA_FILE_LOCATION); + + bool success = testManager.execTestCases(sync_amount); + + opt_response_content = (success ? "" : "not completely " /* completed cycle and no repeats, rare case */); + opt_response_content += "processed "; + opt_response_content += anna::functions::asString(sync_amount); + opt_response_content += ((sync_amount > 1) ? " test cases synchronously" : " test case"); + } else if(param1 == "ip-limit") { if (numParams > 2) throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION); @@ -2130,7 +2164,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 +2173,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; } -