(06.02.2018, 16:40)admin Wrote: You have to specify correct resolution in seconds, by default it is set to 1 day - 86400 seconds.
I'm still confused...
I took the example of the documentation and adapted where necessary:
Code:
require('trends')
dates = {
['start'] = { year = 2018, month = 2, day = 5},
['end'] = { year = 2018, month = 2, day = 6 },
}
--fetch current value
day = trends.fetch('CPU load', dates,300)
for i, v in ipairs(day) do log(i,v) end
This gives me 4 results. If I compare those results with the data in the trend, they don't match.
Result from script: 0,19, 0,12, 0,28, 0,34
Last 4 results in trend graph: 0,38, 0,33, 0.41, 0.33
I want to obtain the last result (0.33)...
Edit: if I run "day = trends.fetchone('CPU load', dates)" it returns 0.31 when at the same time in the graph is shows 0.1 as the latest value
BR