From: Eduardo Ramos Testillano Date: Mon, 8 Jun 2015 12:58:09 +0000 (+0200) Subject: Allow values lesser than 600000 msecs in launcher timex Engine. Warning over 5 minute... X-Git-Tag: REFACTORING_TESTING_LIBRARY~130 X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=commitdiff_plain;h=a211583cf603238caf00f0aa6b59ece84fb12864 Allow values lesser than 600000 msecs in launcher timex Engine. Warning over 5 minutes (300000) for configured parameters --- diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index 239095f..8804736 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -282,7 +282,7 @@ void Launcher::checkTimeMeasure(const char * commandLineParameter, bool optional if(anna::functions::isLike("^[0-9]+$", parameter)) { // para incluir numeros decimales: ^[0-9]+(.[0-9]+)?$ int msecs = cl.getIntegerValue(commandLineParameter); - if(msecs > a_timeEngine->getMaxTimeout()) { + if(msecs > a_timeEngine->getMaxTimeout()) { // 600000 ms std::string msg = "Commandline parameter '"; msg += commandLineParameter; msg += "' is greater than allowed max timeout for timming engine: "; @@ -290,6 +290,13 @@ void Launcher::checkTimeMeasure(const char * commandLineParameter, bool optional throw RuntimeException(msg, ANNA_FILE_LOCATION); } + if(msecs > 300000) { + std::string msg = "Commandline parameter '"; + msg += commandLineParameter; + msg += "' is perhaps very big (over 5 minutes). Take into account memory consumption issues."; + LOGWARNING(anna::Logger::warning(msg, ANNA_FILE_LOCATION)); + } + if(msecs <= a_timeEngine->getResolution()) { std::string msg = "Commandline parameter '"; msg += commandLineParameter; @@ -336,7 +343,7 @@ throw(anna::RuntimeException) { // if (cl.exists ("clone")) // workMode = anna::comm::Communicator::WorkMode::Clone; a_communicator = new MyCommunicator(workMode); - a_timeEngine = new anna::timex::Engine((anna::Millisecond)300000, (anna::Millisecond)150); + a_timeEngine = new anna::timex::Engine((anna::Millisecond)600000, (anna::Millisecond)150); // Counters record procedure: anna::Millisecond cntRecordPeriod = (anna::Millisecond)300000; // ms diff --git a/include/anna/timex/Engine.hpp b/include/anna/timex/Engine.hpp index c40edde..4283d15 100644 --- a/include/anna/timex/Engine.hpp +++ b/include/anna/timex/Engine.hpp @@ -71,7 +71,7 @@ public: Asocia automatica el objeto controlador de tiempo a la instancia de nuestra aplicacin. - @param maxTimeout minima duracion de los eventos de tiempo que vamos a establecer. + @param maxTimeout maxima duracion de los eventos de tiempo que vamos a establecer. @param resolution Resolucion ofrecida para este controlador de tiempos. La duracion minima de un evento de tiempo de ser igual o mayor a este parametro. */