[ZBXNEXT-656] New parameter for granularity in history.get Created: 2011 Feb 10 Updated: 2019 Feb 25 |
|
Status: | Open |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | API (A) |
Affects Version/s: | 1.8.4 |
Fix Version/s: | None |
Type: | Change Request | Priority: | Minor |
Reporter: | Jacobo Aragunde Pérez | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 6 |
Labels: | graphs, history, patch, trends | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() |
Description |
When retrieving history data through the JSON-RPC API, dealing with data from a wide lapse of time is painful because all the samples are returned, but it's very likely that I don't need such degree of detail. Take, for example, a use case where I want to draw a chart for one year history. I will need, at most, one sample for each pixel of the chart's width, and not all history. I propose creating an additional parameter to express the number of samples you want to get. It would divide the history in N groups of the same time length and return an average value for each group. It's different from the limit parameter, which only returns the first N rows of the history. Since it's an important feature for me, I've started working on a patch that I'll upload here soon. I'm taking inspiration from frontend/php/include/classes/class.cchart.php, function selectData(), which is used to gather history data to build charts in the web frontend. |
Comments |
Comment by richlv [ 2011 Feb 10 ] |
first, ability to get trend data might be useful in some cases as well. |
Comment by Jacobo Aragunde Pérez [ 2011 Feb 10 ] |
Patch. Apply with -p1. |
Comment by Jacobo Aragunde Pérez [ 2011 Feb 10 ] |
I've just added a patch. I've followed the coding conventions but I'm not sure about the naming of the file and the format of the patch, so please correctly if I'm wrong. I used 1.8.4 version code as base. What this patch does:
|
Comment by richlv [ 2011 Feb 11 ] |
as far as i recall (as a noncoder), ZBX_GRAPH_MAX_SKIP_CELL was used to figure out how many values we may miss before having a gap in the graph, thus i suspect it would not be useful in this case |
Comment by richlv [ 2011 Sep 12 ] |
maybe this could at least somewhat help with |
Comment by richlv [ 2012 Apr 20 ] |
ZBXNEXT-1192 seems to be very similar |
Comment by Oleksii Zagorskyi [ 2015 Apr 30 ] |
I recall long time ago I was surprised to see ZBX_GRAPH_MAX_SKIP_CELL in the function where we decide where get data from - history or trends. When commenting other issues ( My feeling was and still is that we need to split ZBX_GRAPH_MAX_SKIP_CELL to two definitions and use new definition in the function where we select source of data - history or trends. |
Comment by Andre Guilhon [ 2015 Jul 07 ] |
I would appreciate this feature very much! I'm on 2.4 now, and I still miss this feature! |