From d3925d12f03b48581ebc4464d9ed82e32acea865 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Mon, 30 Aug 2010 23:50:34 +0100 Subject: Properly calculate the index of first result row --- jarmon/jarmon.js | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/jarmon/jarmon.js b/jarmon/jarmon.js index ed26702..32e0283 100644 --- a/jarmon/jarmon.js +++ b/jarmon/jarmon.js @@ -190,14 +190,6 @@ jarmon.RrdQuery.prototype.getData = function(startTimeJs, endTimeJs, dsId, cfNam var endTime = lastPdpTime; if(endTimeJs) { endTime = endTimeJs/1000; - // If end time stamp is beyond the range of this rrd then reset it - // XXX: Is this the correct behaviour. Perhaps better to throw exception - // or simply return nan for each missing PDP - like rrdtool fetch. - if(lastPdpTime < endTime) { - endTime = lastPdpTime; - } else { - endTime = Math.round(endTime / minStep) * minStep; - } } if(dsId == null) { @@ -209,7 +201,7 @@ jarmon.RrdQuery.prototype.getData = function(startTimeJs, endTimeJs, dsId, cfNam cfName = 'AVERAGE'; } - var rra, step, rraRowCount, firstPdpTime; + var rra, step, rraRowCount, lastRowTime, firstRowTime; for(var i=0; i