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

Correcting text replacement error for naming

parent cd1d2268
......@@ -25,6 +25,8 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//================================================================================
#include "PerSystSqlConfigurator.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/foreach.hpp>
#include <boost/property_tree/detail/ptree_implementation.hpp>
......@@ -34,7 +36,6 @@
#include "../../includes/OperatorConfiguratorTemplate.h"
#include "../../includes/UnitInterface.h"
#include "PerSystSqlOperatorConfigurator.h"
PerSystSqlConfigurator::PerSystSqlConfigurator(): JobOperatorConfiguratorTemplate() {
_operatorName = "persystsql";
......@@ -60,7 +61,7 @@ void PerSystSqlConfigurator::sensorBase(AggregatorSensorBase& s, CFG_VAL config)
s.setOperation(AggregatorSensorBase::MIN);
else if (opName == "std")
s.setOperation(AggregatorSensorBase::STD);
else if (opName == "deciles" || opName == "percentiles")
else if (opName == "deciles" || opName == "percentiles" || opName == "quantile")
s.setOperation(AggregatorSensorBase::QTL);
else if (opName == "observations")
s.setOperation(AggregatorSensorBase::OBS);
......@@ -92,9 +93,11 @@ bool PerSystSqlConfigurator::readUnits(PerSystSqlOperator& op,
if(num_quantiles == 0){
return false;
}
bool quantile_found = false;
AggregatorSensorBase quantsensor("");
for(auto &sensor: protoOutputs){
if(sensor->getOperation() == AggregatorSensorBase::QTL){
quantile_found = true;
quantsensor = *(sensor.get());
sensor->setPercentile(0);
auto topic = sensor->getMqtt();
......@@ -103,7 +106,7 @@ bool PerSystSqlConfigurator::readUnits(PerSystSqlOperator& op,
}
}
for(int i = 1; i <= num_quantiles; ++i){
for(int i = 1; i <= num_quantiles && quantile_found; ++i){
auto outputSensor = std::make_shared<AggregatorSensorBase>(quantsensor);
outputSensor->setMqtt(outputSensor->getMqtt() + std::to_string(i));
outputSensor->setOperation(AggregatorSensorBase::QTL);
......
......@@ -25,15 +25,15 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//================================================================================
#ifndef ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLOPERATORCONFIGURATOR_H_
#define ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLOPERATORCONFIGURATOR_H_
#ifndef ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLCONFIGURATOR_H_
#define ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLCONFIGURATOR_H_
#include "../../includes/JobOperatorConfiguratorTemplate.h"
#include "../../includes/UnitTemplate.h"
#include "../aggregator/AggregatorSensorBase.h"
#include "../aggregator/JobAggregatorOperator.h"
#include "../smucngperf/SMUCSensorBase.h"
#include "PerSystSqlOperatorOperator.h"
#include "PerSystSqlOperator.h"
class PerSystSqlConfigurator: public JobOperatorConfiguratorTemplate<PerSystSqlOperator, AggregatorSensorBase> {
public:
......@@ -54,4 +54,4 @@ extern "C" void destroy(OperatorConfiguratorInterface* c) {
delete c;
}
#endif /* ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLOPERATORCONFIGURATOR_H_ */
#endif /* ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLCONFIGURATOR_H_ */
......@@ -25,8 +25,6 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//================================================================================
#include "PerSystSqlOperatorOperator.h"
#include <boost/log/sources/record_ostream.hpp>
#include <boost/log/trivial.hpp>
#include <boost/log/utility/formatting_ostream.hpp>
......@@ -40,6 +38,7 @@
#include "../../../common/include/timestamp.h"
#include "../../includes/CommonStatistics.h"
#include "../../includes/QueryEngine.h"
#include "PerSystSqlOperator.h"
PerSystSqlOperator::PerSystSqlOperator(const std::string& name) :
OperatorTemplate(name), JobOperatorTemplate(name), number_of_even_quantiles(0) {
......
......@@ -25,8 +25,8 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//================================================================================
#ifndef ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLOPERATOROPERATOR_H_
#define ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLOPERATOROPERATOR_H_
#ifndef ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLOPERATOR_H_
#define ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLOPERATOR_H_
#include <vector>
......@@ -68,4 +68,4 @@ float severity_formula3(float metric, float threshold, float exponent);
float severity_memory(float metric, float threshold, float max_memory);
constexpr float severity_noformula(){return 0;} //No severity
#endif /* ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLOPERATOROPERATOR_H_ */
#endif /* ANALYTICS_OPERATORS_PERSYSTSQL_PERSYSTSQLOPERATOR_H_ */
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