The expiration time for new job artifacts in CI/CD pipelines is now 30 days (GitLab default). Previously generated artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 1d684738 authored by Micha Mueller's avatar Micha Mueller
Browse files

Skip first reading in delta plugins as it is not very meaningful

parent f9322eec
......@@ -35,6 +35,7 @@ public:
_cacheIndex(0),
_cache(nullptr),
_delta(false),
_firstReading(true),
_readingQueue(nullptr),
_sinkFile(nullptr) {
......@@ -58,6 +59,7 @@ public:
_cacheIndex(0),
_cache(nullptr),
_delta(other._delta),
_firstReading(true),
_latestValue(other._latestValue),
_lastRawValue(other._lastRawValue),
_lastSentValue(other._lastSentValue),
......@@ -78,6 +80,7 @@ public:
_cacheIndex = 0;
_cache.reset(nullptr);
_delta = other._delta;
_firstReading = true;
_latestValue.timestamp = other._latestValue.timestamp;
_latestValue.value = other._latestValue.value;
_lastRawValue.timestamp = other._lastRawValue.timestamp;
......@@ -133,10 +136,16 @@ public:
void storeReading(reading_t rawReading, double factor=1.0, unsigned long long maxValue=ULLONG_MAX) {
reading_t reading = rawReading;
if( _delta ) {
if (rawReading.value < _lastRawValue.value)
reading.value = (rawReading.value + (maxValue - _lastRawValue.value)) * factor;
else
reading.value = (rawReading.value - _lastRawValue.value) * factor;
if (!_firstReading) {
if (rawReading.value < _lastRawValue.value)
reading.value = (rawReading.value + (maxValue - _lastRawValue.value)) * factor;
else
reading.value = (rawReading.value - _lastRawValue.value) * factor;
} else {
_firstReading = false;
_lastRawValue = rawReading;
return;
}
_lastRawValue = rawReading;
}
else
......@@ -172,6 +181,7 @@ protected:
unsigned int _cacheIndex;
std::unique_ptr<reading_t[]> _cache;
bool _delta;
bool _firstReading;
reading_t _latestValue;
reading_t _lastRawValue;
reading_t _lastSentValue;
......
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