2 #include <Poco/Logger.h>
23 if ((resourceLimit.cpuMax > 0) || (resourceLimit.iowaitMax > 0))
25 if (resourceLimit.cpuMax > 0)
33 if (resourceLimit.iowaitMax > 0)
42 if (resourceLimit.diskFree > 0 || resourceLimit.diskFreeMin)
44 std::stringstream outMsg;
45 outMsg <<
" resourceLimit.diskFreeMin = " << resourceLimit.diskFreeMin
47 <<
"\nresourceLimit.diskFree = " << resourceLimit.diskFree
49 Poco::Logger::root().log(Poco::Message(
drce_const::moduleName, outMsg.str(), Poco::Message::Priority::PRIO_TRACE));
62 if (resourceLimit.rramFree > 0.0 || resourceLimit.rramFreeMin || resourceLimit.vramFree > 0.0 || resourceLimit.vramFreeMin)
64 std::stringstream outMsg;
65 outMsg <<
" resourceLimit.rramFreeMin = " << resourceLimit.rramFreeMin
67 <<
"\nresourceLimit.rramFree = " << resourceLimit.rramFree
69 <<
"\nresourceLimit.vramFreeMin = " << resourceLimit.vramFreeMin
71 <<
"\nresourceLimit.vramFree = " << resourceLimit.vramFree
73 Poco::Logger::root().log(Poco::Message(
drce_const::moduleName, outMsg.str(), Poco::Message::Priority::PRIO_TRACE));
96 if (resourceLimit.procMax || resourceLimit.threadsMax)
98 unsigned int processCount = 0;
99 unsigned int threadsCount = 0;
100 getUsingProcessAndThreads(processCount, threadsCount);
102 std::stringstream outMsg;
103 outMsg <<
" processCount = " << processCount <<
" threadsCount = " << threadsCount;
104 Poco::Logger::root().log(Poco::Message(
drce_const::moduleName, outMsg.str(), Poco::Message::Priority::PRIO_TRACE));
106 if (resourceLimit.procMax)
108 if (resourceLimit.procMax < processCount)
113 if (resourceLimit.threadsMax)
115 if (resourceLimit.threadsMax < threadsCount)
122 void DRCEResourceLimitsChecker::getUsingProcessAndThreads(
unsigned int& processCount,
unsigned int& threadsCount)
130 if (resourceUsageLimit.iowaitMax > 0)
138 if (resourceUsageLimit.vramMax > 0 || resourceUsageLimit.rramMax > 0 || resourceUsageLimit.diskMax > 0 || resourceUsageLimit.diskMaxBytes > 0)
142 if (resourceUsageLimit.vramMax > 0)
146 if (resourceUsageLimit.vramMax < usedPercent)
152 if (resourceUsageLimit.rramMax > 0)
156 if (resourceUsageLimit.rramMax < usedPercent)
162 if (resourceUsageLimit.diskMax > 0)
166 if (resourceUsageLimit.diskMax < usedPercent)
172 if (resourceUsageLimit.diskMaxBytes > 0)
174 if (resourceUsageLimit.diskMaxBytes < fieldsArray.
disk)