10.12., 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 3d9aed4f authored by Carla Guillen Carias's avatar Carla Guillen Carias

One of the plugins was taking the wrong timestamp.

parent 96356b39
......@@ -162,14 +162,16 @@ void PerSystSqlOperator::compute(U_Ptr unit, qeJobData& jobData) {
}
}
}
uint64_t measurement_ts = 0;
if(_buffer.size() == 0){
LOG(error) << "PerSystSql Operator " << _name << ": no data in queryEngine found!";
return;
} else {
measurement_ts = _buffer[0].timestamp;
}
Aggregate_info_t agg_info;
compute_internal(unit, _buffer, agg_info);
agg_info.timestamp = (measurement_ts/1e9);
compute_internal(unit, _buffer, agg_info, measurement_ts); //it can't possibly be zero here
if( _backend == MARIADB ) {
if (!_persystdb->isInitialized()
......@@ -192,7 +194,7 @@ void PerSystSqlOperator::compute(U_Ptr unit, qeJobData& jobData) {
_persystdb->updateJobsLastSuffix(jobData.jobId, jobData.userId, jobData.nodes.size(), agg_info.job_id_db, table_suffix);
agg_info.timestamp = (my_timestamp/1e9);
_persystdb->insertInAggregateTable(table_suffix, agg_info);
}
}
......@@ -205,12 +207,12 @@ void PerSystSqlOperator::convertToDoubles(std::vector<reading_t> &buffer, std::v
}
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, uint64_t measurement_ts) {
_quantileSensors.clear();
reading_t reading;
AggregatorSensorBase::aggregationOps_t op;
reading.timestamp = getTimestamp() - _go_back_ns;
reading.timestamp = measurement_ts;
std::vector<double> douBuffer;
convertToDoubles(buffer, douBuffer);
......
......@@ -163,7 +163,7 @@ private:
protected:
virtual void compute(U_Ptr unit) override;
void compute_internal(U_Ptr& unit, vector<reading_t>& buffer, Aggregate_info_t &agg_info);
void compute_internal(U_Ptr& unit, vector<reading_t>& buffer, Aggregate_info_t &agg_info, uint64_t measurement_ts);
double computeSeverityAverage(vector<double> & buffer);
void convertToDoubles(std::vector<reading_t> &buffer, std::vector<double> &douBuffer);
bool execOnStart() override;
......
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