Commit b9994662 authored by Alessio Netti's avatar Alessio Netti

Dcdbpusher: msg rate computation now takes into account subsampling

parent a6e073a8
......@@ -315,7 +315,10 @@ void MQTTPusher::computeMsgRate() {
bool dynWarning = false;
for (auto &p : _plugins) {
for (const auto &g : p.configurator->getSensorGroups()) {
msgRate += (float)g->acquireSensors().size() * (1000.0f / (float)g->getInterval()) / (float)g->getMinValues();
for(const auto &s : g->acquireSensors()) {
if (s->getSubsampling() > 0)
msgRate += (1000.0f / (float) g->getInterval()) / ((float) g->getMinValues() * s->getSubsampling());
}
g->releaseSensors();
}
}
......@@ -323,7 +326,10 @@ void MQTTPusher::computeMsgRate() {
for (const auto &op : p.configurator->getOperators()) {
if (op->getStreaming() && !op->getDynamic()) {
for (const auto &u : op->getUnits())
msgRate += (float)u->getBaseOutputs().size() * (1000.0f / (float)op->getInterval()) / (float)op->getMinValues();
for(const auto &s : u->getBaseOutputs()) {
if (s->getSubsampling() > 0)
msgRate += (1000.0f / (float) op->getInterval()) / ((float) op->getMinValues() * s->getSubsampling());
}
op->releaseUnits();
} else if (op->getDynamic())
dynWarning = true;
......
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