Skip to content

Commit

Permalink
when multiple pulses per second are received for a single sensor, rrd…
Browse files Browse the repository at this point in the history
…tool will reject the new series of measurements: minimum one second step. introduce a fix in the Flukso daemon
  • Loading branch information
icarus75 committed Apr 19, 2010
1 parent 25c49be commit 5f516e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openwrt/package/flukso/src/flukso.lua
Expand Up @@ -79,12 +79,14 @@ function buffer(child, interval)
return coroutine.create(function(meter, timestamp, value)
local measurements = data.new()
local threshold = os.time() + interval
local old_timestamp = 0

while true do
if meter ~= nil and timestamp > 1234567890 then measurements:add(meter, timestamp, value) end
if meter ~= nil and timestamp > math.max(1234567890, old_timestamp) then measurements:add(meter, timestamp, value) end
if timestamp > threshold and next(measurements) then --checking whether table is not empty
coroutine.resume(child, measurements)
threshold = timestamp + interval
old_timestamp = timestamp
end
meter, timestamp, value = coroutine.yield()
end
Expand Down

0 comments on commit 5f516e2

Please sign in to comment.