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

Commit 07345740 authored by Michael Ott's avatar Michael Ott

Account for subsampling when calculating message rates

parent a6b645a6
......@@ -200,7 +200,13 @@ class SensorGroupInterface {
*
* @return The message rate in messages/s.
*/
virtual float getMsgRate() { return (float)_baseSensors.size() * (1000.0f / (float)_interval) / (float)_minValues; }
virtual float getMsgRate() {
float val = 0;
for (const auto s: _baseSensors) {
val+= 1.0f / s->getSubsampling();
}
return val * (1000.0f / (float)_interval) / (float)_minValues;
}
/**
* @brief Print interface configuration.
......
......@@ -54,11 +54,13 @@ float IPMISensorGroup::getMsgRate() {
for (const auto &s : _sensors) {
switch(s->getType()) {
case IPMISensorBase::sensorType::xccDatastorePower:
msgRate+= 3000.0f / (s->getSubsampling() * _minValues);
break;
case IPMISensorBase::sensorType::xccBulkPower:
msgRate+= 100.0f / _minValues;
msgRate+= 100.0f / (s->getSubsampling() * _minValues);
break;
case IPMISensorBase::sensorType::xccBulkEnergy:
msgRate+= 101.0f / _minValues;
msgRate+= 101.0f / (s->getSubsampling() * _minValues);
break;
default:
msgRate+= SensorGroupTemplate::getMsgRate();
......
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