ziutek / rrd

Bindings to rrdtool
Other
147 stars 44 forks source link

Add Fetch(). #2

Closed hnakamur closed 11 years ago

hnakamur commented 11 years ago

Hi, I added Fetch(), a function which wraps rrd_fetch_r(). Could you review this pull request? Thanks

ziutek commented 11 years ago

LGTM

ziutek commented 11 years ago

Can you check Fetch code. I compared values from test and 'rrdtool dump /tmp/test.rrd' result and they are different. Eg. cnt shold be 1 for all valid points but test gives such result:

datasource: cnt 2013-04-03 15:08:15 +0200 CEST NaN 2013-04-03 15:08:16 +0200 CEST 0.000000e+00 2013-04-03 15:08:17 +0200 CEST 1.000000e+00 2013-04-03 15:08:18 +0200 CEST 1.500000e+00 2013-04-03 15:08:19 +0200 CEST 1.000000e+00 2013-04-03 15:08:20 +0200 CEST 3.000000e+00 2013-04-03 15:08:21 +0200 CEST 1.000000e+00 2013-04-03 15:08:22 +0200 CEST 4.500000e+00 2013-04-03 15:08:23 +0200 CEST 1.000000e+00 2013-04-03 15:08:24 +0200 CEST 6.000000e+00 2013-04-03 15:08:25 +0200 CEST 1.000000e+00 2013-04-03 15:08:26 +0200 CEST 7.500000e+00 2013-04-03 15:08:27 +0200 CEST 1.000000e+00 2013-04-03 15:08:28 +0200 CEST 9.000000e+00 2013-04-03 15:08:29 +0200 CEST 1.000000e+00 2013-04-03 15:08:30 +0200 CEST 1.050000e+01 2013-04-03 15:08:31 +0200 CEST 1.000000e+00 2013-04-03 15:08:32 +0200 CEST 1.200000e+01 2013-04-03 15:08:33 +0200 CEST 1.000000e+00 2013-04-03 15:08:34 +0200 CEST 1.350000e+01 2013-04-03 15:08:35 +0200 CEST 1.000000e+00 2013-04-03 15:08:36 +0200 CEST 2.000000e+01

I modified end variable in rrd_test.go to point exactly to the last value, so there shold be no interpolation errors in "datasource: g".

hnakamur commented 11 years ago

I sent another pull request https://github.com/ziutek/rrd/pull/3 to fix this. Could you review it?

ziutek commented 11 years ago

Now it seems to work correct