This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Get last value of trend
#6
(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
Reply


Messages In This Thread
Get last value of trend - by baggins - 06.02.2018, 12:29
RE: Get last value of trend - by Daniel - 06.02.2018, 13:37
RE: Get last value of trend - by baggins - 06.02.2018, 13:42
RE: Get last value of trend - by Daniel - 06.02.2018, 16:33
RE: Get last value of trend - by admin - 06.02.2018, 16:40
RE: Get last value of trend - by baggins - 06.02.2018, 17:12
RE: Get last value of trend - by buuuudzik - 06.02.2018, 17:57
RE: Get last value of trend - by baggins - 06.02.2018, 18:23
RE: Get last value of trend - by buuuudzik - 06.02.2018, 18:24

Forum Jump: