Commit 444b728d authored by Alessio Netti's avatar Alessio Netti

Analytics: fixes to PersystSQL operator

parent 88f9340d
......@@ -86,7 +86,7 @@ void PerSystSqlConfigurator::operatorAttributes(PerSystSqlOperator& op, CFG_VAL
}
} else if (boost::iequals(val.first, "go_back_ms")) {
try {
auto go_back_ms = std::stoi(val.second.data());
uint64_t go_back_ms = std::stoull(val.second.data());
op.setGoBackInMs(go_back_ms);
} catch (const std::exception &e) {
LOG(error) << " Error parsing go_back_ms \"" << val.second.data() << "\": " << e.what();
......
......@@ -100,7 +100,7 @@ void PerSystSqlOperator::printConfig(LOG_LEVEL ll) {
LOG_VAR(ll) << "PerSystSQL Operator " << _name;
LOG_VAR(ll) << "====================================";
LOG_VAR(ll) << "backend=" << _backend;
LOG_VAR(ll) << "go_back_ms=" << _go_back_ns/1e6;
LOG_VAR(ll) << "go_back_ms=" << _go_back_ns/1000000;
LOG_VAR(ll) << "scaling_factor=" << _scaling_factor;
LOG_VAR(ll) << "batch_domain=" << _batch_domain;
if(_backend == MARIADB){
......@@ -145,7 +145,7 @@ void PerSystSqlOperator::compute(U_Ptr unit, qeJobData& jobData) {
// Clearing the buffer, if already allocated
_buffer.clear();
size_t elCtr = 0;
uint64_t tolerance_ms = (uint64_t)_interval * 2 / 3;
uint64_t tolerance_ms = (uint64_t)_interval;
uint64_t my_timestamp = getTimestamp() - _go_back_ns;
// Too early to fetch data for the job
......
......@@ -97,8 +97,8 @@ public:
_severity_threshold = severityThreshold;
}
void setGoBackInMs(int go_back_ms){
_go_back_ns = go_back_ms * 1e6;
void setGoBackInMs(uint64_t go_back_ms){
_go_back_ns = go_back_ms * 1000000;
}
void setBackend(Backend_t backend) {
......@@ -147,7 +147,7 @@ private:
double _severity_exponent;
double _severity_max_memory;
std::vector<double> _severities;
int _go_back_ns;
uint64_t _go_back_ns;
Backend_t _backend;
double _scaling_factor;
bool _searchedOnceForMetaData;
......
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