Commit db3042e2 authored by Alessio Netti's avatar Alessio Netti

Analytics: handling missing data in Cooling Control plugin

parent 1d39890a
......@@ -83,21 +83,14 @@ bool CoolingControlOperator::execOnStart() {
void CoolingControlOperator::compute(U_Ptr unit) {
// Querying input data
std::vector<std::vector<reading_t>> buffer;
uint64_t rCtr = 0;
for(const auto& in : unit->getInputs()) {
std::vector<reading_t> bufferInt;
if (!_queryEngine.querySensor(in->getName(), _window, 0, bufferInt, true) || bufferInt.empty()) {
LOG(debug) << "Operator " + _name + ": cannot read from sensor " + in->getName() + "!";
}
rCtr += bufferInt.size();
buffer.push_back(bufferInt);
}
// No sensor data available - we just return
if( rCtr == 0 ) {
return;
}
// Establishing the new setting - needs to be a 32-bit signed integer
int newSetting=-1;
if( _strategy == "continuous" ) {
......@@ -167,6 +160,9 @@ uint64_t CoolingControlOperator::getNumHotNodes(std::vector<std::vector<reading_
if (hotNode) {
numHotNodes++;
}
// Missing data automatically results in a hot node being counted, as a failsafe measure
} else {
numHotNodes++;
}
}
return numHotNodes;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment