Graphs getting cut on top without YMax

Bug #1007480 reported by Guzmán Brasó on 2012-06-01
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Graphite
New
Undecided
Unassigned
Ubuntu
Undecided
Unassigned

Bug Description

Hi,

I've been using graphite for a while, now in a new installation I'm seeing something very strange and I'm unable to find what's going on as no log or obvios problems can be seen.

The problem is that I've two metrics, one have a peak between "None" values of 6.71 and a second metric without None values with two peaks of 6.33 and 6.316. However, the graph shows up to value 6 and peaks get cut. Exactly what one would expect if graph would have yMax=6, however there's no yMax value at all.

Url example:
/render?width=400&from=09%3A10_20120601&until=09%3A30_20120601&height=300&target=asi.asiprod.wsdl.ajfaw052.speed&target=asi.asiprod.wsdl.ajfaw088.speed&drawNullAsZero=true

Raw data same example:
asi.asiprod.wsdl.ajfaw052.speed,1338552660,1338553860,60|5.227,3.6905,4.561,4.875,5.3055,4.371,5.05166666667,5.15685714286,5.825,5.84442857143,4.44125,4.99366666667,6.21233333333,4.2284,4.1155,4.4375,6.33066666667,6.316,4.1262,4.645
asi.asiprod.wsdl.ajfaw088.speed,1338552660,1338553860,60|None,None,None,6.709,None,None,None,None,None,None,None,4.659,None,2.31033333333,2.026,3.8355,None,None,None,3.958

I've attached an image which belongs to the above url and shows this weird behavior.

Any ideas of what could be going on?

I've checked all logs I've found (through find /opt/graphite|grep log$) and no line is appended while loading this graph.

Thank you!

Guzmán

Guzmán Brasó (guzman) wrote :
Michael Leinartas (mleinartas) wrote :

This does look like incorrect behavior. What version of graphite are you on?

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed
Bryan Tsai (bryantsai) wrote :

The problem relates to the way of calculating y-axis range. The calculation in many cases would use a yStep causing the final yTop smaller than the actual yMaxValue.

I added the following as a quick work-around so that max value is always shown on the chart. The drawback is sometimes there would be 7 steps (not a big deal compared to be cutting off the top).

----/opt/graphite/webapp/graphite/render/glyph.py
1069,1070d1068
< if self.yLabelValues[-1] < yMaxValue:
< self.yLabelValues.append(self.yLabelValues[-1] + self.yStep)

Wesley Ren (wesleyzren) wrote :

Thanks, Bryan. That fixed in the problem for the main (left) axis, but not for the secondary (right) yAxis.
I believe we can do the same for self.yLabelValuesR too. Let me take a look and will post...

John E (jdemod) wrote :

Any update on the secondary yAxis fix?

Wesley Ren (wesleyzren) wrote :

I added following lines for my Graphite version 1.9.0 to work around this problem.
The first one is for one y-axis.
The second and third are for graphs with left and right y-axises.
diff glyph.py.20130923_1224 glyph.py
1068a1069,1070
> if self.yLabelValues[-1] < yMaxValue:
> self.yLabelValues.append(self.yLabelValues[-1] + self.yStep)
1241a1244,1245
> if self.yLabelValuesL[-1] < yMaxValueL:
> self.yLabelValuesL.append(self.yLabelValuesL[-1] + self.yStepL)
1242a1247,1248
> if self.yLabelValuesR[-1] < yMaxValueR:
> self.yLabelValuesR.append(self.yLabelValuesR[-1] + self.yStepR)

Wesley Ren (wesleyzren) wrote :

Basically, you need to find following lines and add their corresponding fixes:
self.yLabelValues = self.getYLabelValues(self.yBottom, self.yTop, self.yStep)

self.yLabelValuesL = self.getYLabelValues(self.yBottomL, self.yTopL, self.yStepL)

self.yLabelValuesR = self.getYLabelValues(self.yBottomR, self.yTopR, self.yStepR)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers