Add test to avoid RRD overlapping paths

This commit is contained in:
emanuele-f 2019-05-14 20:23:20 +02:00
parent c1057bbc7f
commit f31451d0bb
4 changed files with 89 additions and 8 deletions

View file

@ -58,6 +58,8 @@ end
-- ##############################################
-- When performing the derivative between two points, the delta must be calculated
-- and accounted for the first point time
function test_simple_derivative(test)
local test_data = {
{{v=1000}, now},
@ -76,10 +78,10 @@ function test_simple_derivative(test)
local rv = test_utils.timestampAsKey(test_utils.makeTimeStamp(res.series, res.start, schema.options.step))[1]
local t2 = test_data[2][2]
local t1 = test_data[1][2]
if not(rv[t2] == 1000) then
return test:assertion_failed("rv[t2=".. t2 .."] == 1000")
if not(rv[t1] == 1000) then
return test:assertion_failed("rv[t1=".. t1 .."] == 1000")
end
return test:success()