[ZBX-9919] Change graph type from pie (and graph sum) to normal and Y scale calculation fails Created: 2015 Sep 30 Updated: 2017 May 30 Resolved: 2015 Oct 14 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 2.4.6 |
Fix Version/s: | 2.2.11rc1, 2.4.7rc1, 3.0.0alpha3 |
Type: | Incident report | Priority: | Critical |
Reporter: | Linwood Ferguson | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | graphs, piegraphs | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Ubuntu 15.04, Postgresql 9.4 (but I think any) |
Attachments: | reproduced.png |
Description |
I found that some graphs were not correctly calculating the Y min/max so as to permit all items to be viewed. Upon further testing, a reproducible case is caused by the UI not resetting the "graphs_items" table field "type" from 2 to 0. To reproduce the problem: 1) Pick a host which has something like total disk space and used disk space, where the used is substantially less than the total. 2) Create a graph for the host: 3) Add (i.e. save). 4) If you query the tables, in graphs_items, the type field is set (as appropriate) to 2. The graph works fine at this point. 5) Now go back in and edit the graph: 6) If you query the tables, the type is still set to 2, which ideally would be irrelevant, but (as you see) is not. 7) Display the graph – notice that the Y scale is set based solely on the used space, not the total (the total is likely off the screen entirely). 8) If you use SQL to reset the type from 2 to 0, and redisplay the graph, it scales correctly (at least for me nothing was cached, in theory you might need to stop the server before doing the SQL update, and start after). This also is inherited with templates, so if you define a graph prototype in this fashion, when the LLD creates the actual graphs, the "2" is propagated to the individual disks and hosts, and continues to cause all (or almost all) of them to function incorrectly. I would argue there are two separate issues; one is that the type of "2" probably should not even be looked at for line/region graphs, but more to the point when changing the graph type to normal, the graph-sum value should be reset as part of changing the graph type. While either would fix this particular problem, the latter is probably the most conservative fix in case the type=2 is handled differently elsewhere. |
Comments |
Comment by Oleksii Zagorskyi [ 2015 Sep 30 ] |
More short description: To reproduce easier: CONFIRMED ! |
Comment by Oleksii Zagorskyi [ 2015 Oct 01 ] |
I'd prefer to keep the type=2 in database, but ignore it for Normal graphs. |
Comment by richlv [ 2015 Oct 01 ] |
but type=2 is meaningless for normal graphs, what's the point keeping it ? |
Comment by Oleksii Zagorskyi [ 2015 Oct 01 ] |
When user switch a graph back to Pie - those settings will be preserved. |
Comment by Linwood Ferguson [ 2015 Oct 01 ] |
To the "leave 2 in database" one question for consideration: Why did the scale calculation even look at that field? I ask because that answer might indicate if other not yet discovered code also (inappropriately) looks at the same field? |
Comment by vitalijs.cemeris (Inactive) [ 2015 Oct 06 ] |
(1) No translation strings changed. iivs CLOSED. |
Comment by vitalijs.cemeris (Inactive) [ 2015 Oct 06 ] |
RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-9919 |
Comment by Oleksii Zagorskyi [ 2015 Oct 06 ] |
(2) I see this part removed from CLineGraphDraw.php: if ($this->items[$item]['type'] == ITEM_TYPE_TRAPPER) { $draw = true; } which is wrong, IMO. vitalijs.cemeris RESOLVED in r55964 zalex_ua thanks, looks more correct now. should be checked/tested by devs. iivs Please, see minor coding style fix in r56086 vitalijs.cemeris CLOSED |
Comment by Ivo Kurzemnieks [ 2015 Oct 12 ] |
TESTED, but, please, close (2) before merging. Keep in mind that this should be fixed for 2.2 as well. |
Comment by vitalijs.cemeris (Inactive) [ 2015 Oct 14 ] |
FIXED IN
|