Commit b37c550a authored by Carla Guillen Carias's avatar Carla Guillen Carias
Browse files

Refactoring confusing names

parent 84186ee0
......@@ -63,7 +63,7 @@ int64_t computeStd(std::vector<reading_t> &buffer) {
return acc;
}
void computeEvenQuantiles(const std::vector<reading_t> &data, unsigned int NUMBER_QUANTILES, std::vector<int64_t> &quantiles) {
void computeEvenQuantiles(std::vector<reading_t> &data, const unsigned int NUMBER_QUANTILES, std::vector<int64_t> &quantiles) {
if (data.empty() || NUMBER_QUANTILES == 0) {
return;
}
......
......@@ -9,7 +9,7 @@
#include "SMUCNGPerfOperator.h"
SMUCNGPerfOperator::SMUCNGPerfOperator(const std::string& name): OperatorTemplate(name) {
_buffers.resize(5);
_buffers.resize(10);
}
SMUCNGPerfOperator::~SMUCNGPerfOperator() {
......@@ -33,12 +33,11 @@ void SMUCNGPerfOperator::compute(U_Ptr unit) {
std::vector<reading_t> & clocks = _buffers[1];
_queryEngine.querySensor(inputs[_metricToPosition[SMUCSensorBase::INSTRUCTIONS]]->getName(), timestamp, timestamp, &instructions, false); //use absolute timestamp
_queryEngine.querySensor(inputs[_metricToPosition[SMUCSensorBase::CLOCKS]]->getName(), timestamp, timestamp, &clocks, false); //use absolute timestamp
reading_t clockspersecond;
reading_t cpi;
bool wascalced = false;
if(instructions.size() > 0 && clocks.size() > 0) {
if(calculateMetricRatio(clocks.begin(),instructions.begin(), outSensor->getScalingFactor(), clockspersecond)){
outSensor->storeReading(clockspersecond);
}
if (instructions.size() > 0 && clocks.size() > 0 && calculateMetricRatio(clocks[0], instructions[0],
outSensor->getScalingFactor(), cpi)) {
outSensor->storeReading(cpi);
}
} else if (outSensor->getPosition() == _metricToPosition[SMUCSensorBase::FREQUENCY]) {
std::vector<reading_t> & clocks = _buffers[0];
......@@ -47,10 +46,8 @@ void SMUCNGPerfOperator::compute(U_Ptr unit) {
_queryEngine.querySensor(inputs[_metricToPosition[SMUCSensorBase::CLOCKS_REF]]->getName(), timestamp, timestamp, &clocks_ref, false); //use absolute timestamp
reading_t frequency;
bool wascalced = false;
if( clocks.size() > 0 && clocks_ref.size() > 0){
if(calculateFrequency(clocks_ref.begin(),clocks.begin(), MIN_FREQ_MHZ, MAX_FREQ_MHZ, frequency)) {
if( clocks.size() > 0 && clocks_ref.size() > 0 && calculateFrequency(clocks_ref[0],clocks[0], MIN_FREQ_MHZ, MAX_FREQ_MHZ, frequency)) {
outSensor->storeReading(frequency);
}
}
}
......
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