Fix issue 208: /data API with points=X returns (X-1) points#253
Fix issue 208: /data API with points=X returns (X-1) points#253whitejava wants to merge 1 commit intonetdata:masterfrom
Conversation
|
It makes sense! Have to tested it? Is it ok now? The worst thing that can happen there is to overflow |
|
ok. I traced it and I don't think we should merge this. Let me explain why: When netdata is reducing metrics, it tries to return always the same boundaries. So, when you say you want 10s averages, it will always return points starting at a Let's see why this is needed. I will show you the error case. Assume we have 5 points:
At 00:04 you ask for 2 points for 4 seconds in the past. So
A second later the chart is to be refreshed, and makes again the same request at 00:05. These are the points that would have been returned:
Wait a moment! The chart was shifted just one point and it changed value! Point 2 was 3.5 and when shifted to point 1 is 2.5 ! If you see this in a chart is a mess. The charts change shape constantly. For this reason, netdata always aligns the data it returns to the When you request So, the proper way to query the database is to also set at least http://netdata.firehol.org/api/v1/data?chart=system.cpu&points=1&after=-10&options=seconds it returns 1 point for the last complete 10-second duration (it starts at So, I don't think we should merge this. |
|
I should also add that even after this PR, the returned value will be misleading. The returned value will not be the average of the 3600 points. It will be the average of 1 up to 3600 points depending on the time you asked for it. |
* Ported php-fpm to Go
No description provided.