Commit 2f5bacbb authored by Alessio Netti's avatar Alessio Netti

Fixes to message rate computation

parent 05a1b44b
......@@ -212,11 +212,14 @@ public:
* @return Messages/s
*/
virtual float getMsgRate() override {
float msgRate = 0;
for (const auto &u : _units) {
msgRate += (float)u->getBaseOutputs().size() * (1000.0f / (float)_interval) / (float)_minValues;
}
return msgRate;
float val = 0.0f;
for (const auto &u : this->getUnits())
for(const auto &s : u->getBaseOutputs()) {
if (s->getSubsampling() > 0)
val += 1.0f / ((float) s->getSubsampling());
}
this->releaseUnits();
return val * (1000.0f / (float)_interval) / (float)_minValues;
}
/**
......
......@@ -203,7 +203,8 @@ class SensorGroupInterface {
virtual float getMsgRate() {
float val = 0;
for (const auto s: _baseSensors) {
val+= 1.0f / s->getSubsampling();
if(s->getSubsampling() > 0)
val+= 1.0f / (float)s->getSubsampling();
}
return val * (1000.0f / (float)_interval) / (float)_minValues;
}
......
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