{"action":"created","issue":{"url":"https://api.github.com/repos/rrd4j/rrd4j/issues/80","repository_url":"https://api.github.com/repos/rrd4j/rrd4j","labels_url":"https://api.github.com/repos/rrd4j/rrd4j/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/rrd4j/rrd4j/issues/80/comments","events_url":"https://api.github.com/repos/rrd4j/rrd4j/issues/80/events","html_url":"https://github.com/rrd4j/rrd4j/issues/80","id":131715221,"number":80,"title":"Error with resolution in fetch requests","user":{"login":"jlorenzocima","id":10747008,"avatar_url":"https://avatars.githubusercontent.com/u/10747008?v=3","gravatar_id":"","url":"https://api.github.com/users/jlorenzocima","html_url":"https://github.com/jlorenzocima","followers_url":"https://api.github.com/users/jlorenzocima/followers","following_url":"https://api.github.com/users/jlorenzocima/following{/other_user}","gists_url":"https://api.github.com/users/jlorenzocima/gists{/gist_id}","starred_url":"https://api.github.com/users/jlorenzocima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlorenzocima/subscriptions","organizations_url":"https://api.github.com/users/jlorenzocima/orgs","repos_url":"https://api.github.com/users/jlorenzocima/repos","events_url":"https://api.github.com/users/jlorenzocima/events{/privacy}","received_events_url":"https://api.github.com/users/jlorenzocima/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-02-05T18:17:50Z","updated_at":"2016-08-23T15:17:47Z","closed_at":null,"body":"Hi Fabrice,\r\nI doing some test with rrd4j and found an error with fetch when change resolution. I could not make it work, then check the same example with rrdtool and worked well.\r\n\r\nBellow copy the example using rrdtool and rr4j test cases with the corresponding outputs.\r\n\r\nThis is a error in rrd4j or I do some mistake?\r\n\r\nI'm using: \r\n  * rrd4j 2.2\r\n  * rrdtool 1.3.8\r\n  * CentOS 6.7\r\n\r\n## rrdtool Test Case\r\n\r\nrrdtool create test_rrdtool.rrd \\\r\n--start 920202900 \\\r\n--step 30 \\\r\nDS:counter:GAUGE:60:U:U \\\r\nDS:duration:GAUGE:60:U:U \\\r\nRRA:AVERAGE:0:1:20000 \\\r\nRRA:AVERAGE:0:5:200 \r\n\r\nrrdtool update test_rrdtool.rrd -t counter:duration \\\r\n920202928:2:7 \\\r\n920202946:2:11 \\\r\n920202985:2:15 \\\r\n920203002:1:9 \\\r\n920203036:3:33 \\\r\n920203058:1:13 \\\r\n920203103:3:45 \\\r\n920203127:2:35 \\\r\n920203165:3:60 \\\r\n920203198:2:45 \\\r\n920203216:1:24 \\\r\n920203257:2:51 \\\r\n920203282:2:55 \\\r\n920203308:2:59 \\\r\n920203337:2:63 \\\r\n920203355:1:33 \\\r\n920203395:3:105 \\\r\n920203421:2:75 \\\r\n920203454:3:120 \\\r\n920203499:3:129 \\\r\n920203528:3:138\r\n\r\n\r\n###### HERE USING DETAILED RRA\r\nrrdtool fetch test_rrdtool.rrd AVERAGE --start 920202800 --end 920203565\r\n                        counter            duration\r\n\r\n 920202810: -nan -nan\r\n 920202840: -nan -nan\r\n 920202870: -nan -nan\r\n 920202900: -nan -nan\r\n 920202930: 2.0000000000e+00 7.2666666667e+00\r\n 920202960: 2.0000000000e+00 1.2866666667e+01\r\n 920202990: 1.8333333333e+00 1.4000000000e+01\r\n 920203020: 2.2000000000e+00 2.3400000000e+01\r\n 920203050: 2.0666666667e+00 2.3666666667e+01\r\n 920203080: 2.4666666667e+00 3.6466666667e+01\r\n 920203110: 2.7666666667e+00 4.2666666667e+01\r\n 920203140: 2.4333333333e+00 4.5833333333e+01\r\n 920203170: 2.8333333333e+00 5.7500000000e+01\r\n 920203200: 1.9333333333e+00 4.3600000000e+01\r\n 920203230: 1.4666666667e+00 3.6600000000e+01\r\n 920203260: 2.0000000000e+00 5.1400000000e+01\r\n 920203290: 2.0000000000e+00 5.6066666667e+01\r\n 920203320: 2.0000000000e+00 6.0600000000e+01\r\n 920203350: 1.5666666667e+00 5.0000000000e+01\r\n 920203380: 2.6666666667e+00 9.3000000000e+01\r\n 920203410: 2.5000000000e+00 9.0000000000e+01\r\n 920203440: 2.6333333333e+00 1.0350000000e+02\r\n 920203470: 3.0000000000e+00 1.2480000000e+02\r\n 920203500: 3.0000000000e+00 1.2930000000e+02\r\n 920203530: -nan -nan\r\n 920203560: -nan -nan\r\n 920203590: -nan -nan\r\n\r\n###### HERE USE THE SUMMARY (SECOND) RRA\r\nrrdtool fetch test_rrdtool.rrd AVERAGE --start 920202800 --end 920203565 -r 150\r\n                        counter            duration\r\n\r\n 920202900: -nan -nan\r\n 920203050: 2.0200000000e+00 1.6240000000e+01\r\n 920203200: 2.4866666667e+00 4.5213333333e+01\r\n 920203350: 1.8066666667e+00 5.0933333333e+01\r\n 920203500: 2.7600000000e+00 1.0812000000e+02\r\n 920203650: -nan -nan\r\n\r\n\r\n## Rrd4j Test Case\r\n```java\r\n    @Test\r\n    public void test_rrd4j() throws Exception {\r\n        final String RRD_PATH = \"test_rrd4j.rrd\";\r\n        //\r\n        // create RRD definition\r\n        RrdDef rrdDef = new RrdDef(RRD_PATH, 30);\r\n        rrdDef.setStartTime(920202900);\r\n        //\r\n        // create datasources\r\n        rrdDef.addDatasource(\"counter\", DsType.GAUGE,60, Double.NaN, Double.NaN);\r\n        rrdDef.addDatasource(\"duration\", DsType.GAUGE,60, Double.NaN, Double.NaN);\r\n        //\r\n        // create archives\r\n        rrdDef.addArchive(ConsolFun.AVERAGE, 0, 1, 20000);\r\n        rrdDef.addArchive(ConsolFun.AVERAGE, 0, 5, 200);\r\n        //\r\n        // create database\r\n        RrdDb rrdDb = new RrdDb(rrdDef);\r\n        //\r\n        // populate\r\n        Sample sample = rrdDb.createSample();\r\n        sample.setTime(920202928).setValue(\"counter\", 2).setValue(\"duration\", 7).update();\r\n        sample.setTime(920202946).setValue(\"counter\", 2).setValue(\"duration\", 11).update();\r\n        sample.setTime(920202985).setValue(\"counter\", 2).setValue(\"duration\", 15).update();\r\n        sample.setTime(920203002).setValue(\"counter\", 1).setValue(\"duration\", 9).update();\r\n        sample.setTime(920203036).setValue(\"counter\", 3).setValue(\"duration\", 33).update();\r\n        sample.setTime(920203058).setValue(\"counter\", 1).setValue(\"duration\", 13).update();\r\n        sample.setTime(920203103).setValue(\"counter\", 3).setValue(\"duration\", 45).update();\r\n        sample.setTime(920203127).setValue(\"counter\", 2).setValue(\"duration\", 35).update();\r\n        sample.setTime(920203165).setValue(\"counter\", 3).setValue(\"duration\", 60).update();\r\n        sample.setTime(920203198).setValue(\"counter\", 2).setValue(\"duration\", 45).update();\r\n        sample.setTime(920203216).setValue(\"counter\", 1).setValue(\"duration\", 24).update();\r\n        sample.setTime(920203257).setValue(\"counter\", 2).setValue(\"duration\", 51).update();\r\n        sample.setTime(920203282).setValue(\"counter\", 2).setValue(\"duration\", 55).update();\r\n        sample.setTime(920203308).setValue(\"counter\", 2).setValue(\"duration\", 59).update();\r\n        sample.setTime(920203337).setValue(\"counter\", 2).setValue(\"duration\", 63).update();\r\n        sample.setTime(920203355).setValue(\"counter\", 1).setValue(\"duration\", 33).update();\r\n        sample.setTime(920203395).setValue(\"counter\", 3).setValue(\"duration\", 105).update();\r\n        sample.setTime(920203421).setValue(\"counter\", 2).setValue(\"duration\", 75).update();\r\n        sample.setTime(920203454).setValue(\"counter\", 3).setValue(\"duration\", 120).update();\r\n        sample.setTime(920203499).setValue(\"counter\", 3).setValue(\"duration\", 129).update();\r\n        sample.setTime(920203528).setValue(\"counter\", 3).setValue(\"duration\", 138).update();\r\n        //\r\n        // fetch\r\n        FetchRequest fetchRequest = rrdDb.createFetchRequest(ConsolFun.AVERAGE, 920202800, 920203565);\r\n        FetchData fetchData = fetchRequest.fetchData();\r\n        System.out.println(\"Without resolution \\n\"+fetchData.toString());\r\n        fetchRequest = rrdDb.createFetchRequest(ConsolFun.AVERAGE, 920202800, 920203565, 150);\r\n        fetchData = fetchRequest.fetchData();\r\n        System.out.println(\"With resolution 150s \\n\"+fetchData.toString());\r\n        //\r\n        // close db\r\n        rrdDb.close();\r\n\r\n    }\r\n```\r\n\r\n\r\n###### HERE USING DETAILED RRA\r\nOutput Without resolution \r\n                      counter          duration\r\n \r\n 920202780:               nan               nan\r\n 920202810:               nan               nan\r\n 920202840:               nan               nan\r\n 920202870:               nan               nan\r\n 920202900:               nan               nan\r\n 920202930:  +2.0000000000E00  +7.2666666667E00\r\n 920202960:  +2.0000000000E00  +1.2866666667E01\r\n 920202990:  +1.8333333333E00  +1.4000000000E01\r\n 920203020:  +2.2000000000E00  +2.3400000000E01\r\n 920203050:  +2.0666666667E00  +2.3666666667E01\r\n 920203080:  +2.4666666667E00  +3.6466666667E01\r\n 920203110:  +2.7666666667E00  +4.2666666667E01\r\n 920203140:  +2.4333333333E00  +4.5833333333E01\r\n 920203170:  +2.8333333333E00  +5.7500000000E01\r\n 920203200:  +1.9333333333E00  +4.3600000000E01\r\n 920203230:  +1.4666666667E00  +3.6600000000E01\r\n 920203260:  +2.0000000000E00  +5.1400000000E01\r\n 920203290:  +2.0000000000E00  +5.6066666667E01\r\n 920203320:  +2.0000000000E00  +6.0600000000E01\r\n 920203350:  +1.5666666667E00  +5.0000000000E01\r\n 920203380:  +2.6666666667E00  +9.3000000000E01\r\n 920203410:  +2.5000000000E00  +9.0000000000E01\r\n 920203440:  +2.6333333333E00  +1.0350000000E02\r\n 920203470:  +3.0000000000E00  +1.2480000000E02\r\n 920203500:  +3.0000000000E00  +1.2930000000E02\r\n 920203530:               nan               nan\r\n 920203560:               nan               nan\r\n 920203590:               nan               nan\r\n\r\n###### HERE NOT USE THE SUMMARY (SECOND) RRA AND I THINK THIS IS AN ERROR\r\nOutput With resolution 150s \r\n                      counter          duration\r\n \r\n 920202780:               nan               nan\r\n 920202810:               nan               nan\r\n 920202840:               nan               nan\r\n 920202870:               nan               nan\r\n 920202900:               nan               nan\r\n 920202930:  +2.0000000000E00  +7.2666666667E00\r\n 920202960:  +2.0000000000E00  +1.2866666667E01\r\n 920202990:  +1.8333333333E00  +1.4000000000E01\r\n 920203020:  +2.2000000000E00  +2.3400000000E01\r\n 920203050:  +2.0666666667E00  +2.3666666667E01\r\n 920203080:  +2.4666666667E00  +3.6466666667E01\r\n 920203110:  +2.7666666667E00  +4.2666666667E01\r\n 920203140:  +2.4333333333E00  +4.5833333333E01\r\n 920203170:  +2.8333333333E00  +5.7500000000E01\r\n 920203200:  +1.9333333333E00  +4.3600000000E01\r\n 920203230:  +1.4666666667E00  +3.6600000000E01\r\n 920203260:  +2.0000000000E00  +5.1400000000E01\r\n 920203290:  +2.0000000000E00  +5.6066666667E01\r\n 920203320:  +2.0000000000E00  +6.0600000000E01\r\n 920203350:  +1.5666666667E00  +5.0000000000E01\r\n 920203380:  +2.6666666667E00  +9.3000000000E01\r\n 920203410:  +2.5000000000E00  +9.0000000000E01\r\n 920203440:  +2.6333333333E00  +1.0350000000E02\r\n 920203470:  +3.0000000000E00  +1.2480000000E02\r\n 920203500:  +3.0000000000E00  +1.2930000000E02\r\n 920203530:               nan               nan\r\n 920203560:               nan               nan\r\n 920203590:               nan               nan\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rrd4j/rrd4j/issues/comments/241766345","html_url":"https://github.com/rrd4j/rrd4j/issues/80#issuecomment-241766345","issue_url":"https://api.github.com/repos/rrd4j/rrd4j/issues/80","id":241766345,"user":{"login":"fbacchella","id":967097,"avatar_url":"https://avatars.githubusercontent.com/u/967097?v=3","gravatar_id":"","url":"https://api.github.com/users/fbacchella","html_url":"https://github.com/fbacchella","followers_url":"https://api.github.com/users/fbacchella/followers","following_url":"https://api.github.com/users/fbacchella/following{/other_user}","gists_url":"https://api.github.com/users/fbacchella/gists{/gist_id}","starred_url":"https://api.github.com/users/fbacchella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbacchella/subscriptions","organizations_url":"https://api.github.com/users/fbacchella/orgs","repos_url":"https://api.github.com/users/fbacchella/repos","events_url":"https://api.github.com/users/fbacchella/events{/privacy}","received_events_url":"https://api.github.com/users/fbacchella/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T15:17:47Z","updated_at":"2016-08-23T15:17:47Z","body":"I forgot it for 3.0, sorry. But there is snapshot available at https://oss.sonatype.org/content/repositories/snapshots/org/rrd4j/rrd4j/3.1-SNAPSHOT/.\r\n"}}
{"actor":{"display_login":"fbacchella"}}