492162921 / rrd4j

Automatically exported from code.google.com/p/rrd4j
Other
0 stars 0 forks source link

Graph: DataProcessor ignores step set in RrdGraphDef when choosing optimal step for plottable #50

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
data/DataProcessor.java / private void chooseOptimalStep() calculates the 
optimal step using a constant value of  pixelCount (600) instead of the step 
specified in the RrdGraphDef when the data source is not a DEF.

For a plottable, we need to specifiy the step in RrdGraphDef based on a 
non-Rrd4j data source.

To reproduce  problem:

2 days of data, samples at 3 minute intervals

    graphDef.width = 1100
    graphDef.height = 200
    graphDef.startTime = new DateTime(2013, 6,  9, 18, 0, 0, 0, DateTimeZone.UTC)
    graphDef.endTime = new DateTime(2013, 6, 11, 18, 0, 0, 0, DateTimeZone.UTC)
    graphDef.step = 3*60000  // one sample every 3 minute

    // 2 days of samples with 3 minute intervals inclusive start-end
    val sampleCnt =  1 +  (2 * 1440) / 3
    val values = new Array[Double](sampleCnt)

    values(0) =  0.005553

    //examples of spike values skipped with step 288 calculated by RrdGraph
    //based on pixel count of 600
    values(10) =  0.005553

    //another missing spike
    values(690) = 0.005553

    //last data point spike drawn high to end of graph axis,
    //(e.g. one pixel wide with trailing bar)
    values(sampleCnt-1)  =  0.005553

   //Supply data as a Plottable

What is the expected output? What do you see instead?

spikes at (10) and (690) are missing from the graph

Original issue reported on code.google.com by kelleyas...@gmail.com on 21 Aug 2013 at 7:48

Attachments:

GoogleCodeExporter commented 9 years ago
I see no problem in your patch. But I wonder, did you try with  
DataProcessor.setPixelCount(int)  ?

Original comment by fbacche...@gmail.com on 27 Aug 2013 at 11:07