2 #include "ErrorHandler/MessageAnalyzer/ma_function_countpercent.h"
3 #include "ErrorHandler/MessageAnalyzer/ma_condition.h"
4 #include "ErrorHandler/MessageAnalyzer/ma_participants.h"
6 #include <boost/algorithm/string.hpp>
8 using namespace novadaq::errorhandler;
14 if (args.empty() || args.size() < 2)
23 std::string type = boost::any_cast<std::string>(args[0]);
24 boost::to_upper(type);
28 else if (type ==
"TARGET")
33 group = boost::any_cast<std::string>(args[1]);
39 ma_func_count_percent::evaluate(
ma_condition const& cond, ma_cond_domain dom)
42 int count = cond.get_alarm_count(dom, count_type);
43 int total = ma_participants::instance().get_group_participant_count(group);
45 TLOG(TLVL_DEBUG) <<
"count = " << count <<
", participants = " << total;
47 return boost::any((
double)count / total);