Commit d0826699 authored by Carla Guillen's avatar Carla Guillen
Browse files

SMUCNGPerf Operator: implementing memory bandwidth. PerSystSql Operator:...

SMUCNGPerf Operator: implementing memory bandwidth. PerSystSql Operator: fixing issue with one unit not being present, and no calculation was done.
parent 901c105d
......@@ -51,22 +51,17 @@ void PerSystSqlConfigurator::sensorBase(AggregatorSensorBase& s, CFG_VAL config)
{
if (boost::iequals(val.first, "operation")) {
std::string opName = val.second.data();
if (opName == "sum")
s.setOperation(AggregatorSensorBase::SUM);
else if (opName == "average")
if (opName == "average"){
s.setOperation(AggregatorSensorBase::AVG);
else if (opName == "maximum")
s.setOperation(AggregatorSensorBase::MAX);
else if (opName == "minimum")
s.setOperation(AggregatorSensorBase::MIN);
else if (opName == "std")
s.setOperation(AggregatorSensorBase::STD);
else if (opName == "deciles" || opName == "percentiles" || opName == "quantile")
} else if (opName == "deciles" || opName == "percentiles" || opName == "quantile"){
s.setOperation(AggregatorSensorBase::QTL);
else if (opName == "observations")
} else if (opName == "observations" || opName == "numobs") {
s.setOperation(AggregatorSensorBase::OBS);
else if (opName == "average_severity")
s.setOperation(AggregatorSensorBase::AVG_SEV);
} else if (opName == "average_severity"){
s.setOperation(AggregatorSensorBase::AVG_SEV);
} else {
LOG(error) << "PerSystSqlConfigurator operation " << opName << " not supported!" ;
}
}
}
}
......
......@@ -96,13 +96,10 @@ void PerSystSqlOperator::compute(U_Ptr unit, qeJobData& jobData) {
jobData.startTime : jobEnd - my_timestamp;
// Job units are hierarchical, and thus we iterate over all sub-units associated to each single node
for (const auto& subUnit : unit->getSubUnits()) {
// Getting the most recent values as specified in _window
// Since we do not clear the internal buffer, all sensor readings will be accumulated in the same vector
for (const auto& in : subUnit->getInputs()) {
if (!_queryEngine.querySensor(in->getName(), my_timestamp,
my_timestamp, _buffer, false)) {
if (!_queryEngine.querySensor(in->getName(), my_timestamp, my_timestamp, _buffer, false)) {
LOG(debug)<< "PerSystSql Operator " << _name << " cannot read from sensor " << in->getName() << "!";
return;
}
}
}
......@@ -159,8 +156,7 @@ void PerSystSqlOperator::compute(U_Ptr unit, qeJobData& jobData) {
}
}
void PerSystSqlOperator::compute_internal(U_Ptr& unit,
vector<reading_t>& buffer, Aggregate_info_t & agg_info) {
void PerSystSqlOperator::compute_internal(U_Ptr& unit, vector<reading_t>& buffer, Aggregate_info_t & agg_info) {
_quantileSensors.clear();
reading_t reading;
......@@ -176,11 +172,9 @@ void PerSystSqlOperator::compute_internal(U_Ptr& unit,
switch (op) {
case AggregatorSensorBase::AVG:
if (_backend == CASSANDRA) {
reading.value = std::accumulate(douBuffer.begin(),
douBuffer.end(), 0.0) / douBuffer.size()
* _scaling_factor;
reading.value = std::accumulate(douBuffer.begin(), douBuffer.end(), 0.0)/douBuffer.size() * _scaling_factor;
} else {
agg_info.average = std::accumulate(douBuffer.begin(), douBuffer.end(), 0.0) / douBuffer.size();
agg_info.average = std::accumulate(douBuffer.begin(), douBuffer.end(), 0.0)/douBuffer.size();
}
break;
case AggregatorSensorBase::OBS:
......
......@@ -322,10 +322,16 @@ void SMUCNGPerfOperator::computeMISSBRANCHES_TO_TOTAL_BRANCH_RATIO(std::vector<S
}
}
void SMUCNGPerfOperator::computeMEMORY_BANDWIDTH(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr& outSensor,
const uint64_t timestamp) {
std::vector<reading_t> mem_counters;
//ToDo
void SMUCNGPerfOperator::computeMEMORY_BANDWIDTH(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr& outSensor, const uint64_t timestamp) {
std::vector<reading_t> & mem_counters = _buffers[0];
reading_t memory_bw;
query(inputs[_metricToPosition[SMUCSensorBase::CAS_COUNT_READ]]->getName(), timestamp, mem_counters);
query(inputs[_metricToPosition[SMUCSensorBase::CAS_COUNT_WRITE]]->getName(), timestamp, mem_counters);
if(mem_counters.size() > 0 && calculateMemoryBandwidth(mem_counters, memory_bw, _measuring_interval_s)){
outSensor->storeReading(memory_bw);
}
}
bool SMUCNGPerfOperator::isAMetricPerSecond(SMUCSensorBase::Metric_t comp){
......
......@@ -68,6 +68,8 @@ public:
PERF_COUNT_HW_BRANCH_INSTRUCTIONS=32,
PERF_COUNT_HW_BRANCH_MISSES=33,
CORE_TEMPERATURE=34,
CAS_COUNT_READ=35,
CAS_COUNT_WRITE=36,
//
CPI=50,
FREQUENCY=51,
......
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