0

Is there a way to execute the holtWintersConfidenceBands on large period but to get only last x minutes datapoints? For example: I want to execute the holtWintersConfidenceBands function on the last 30 days but to get only the last 30 minutes result from it.

Ofcourse that I can do the filtering on my client but is there a way to achieve it via the Graphite server itself?

Tomer Peled
  • 3,571
  • 5
  • 35
  • 57

1 Answers1

0

This depends on the frequency of data points that you are storing for the 30day interval. If you are storing 1hr data points, you're going to have to do some extra work to get the data you want.

You can just use the Graphite API, pop the data out as JSON, and parse the datapoints array for the data that you want. Basically on any Graphite API call you make to your Graphite server, just add format=json as parameter.

Adam
  • 1,962
  • 2
  • 17
  • 30
  • Yes, but my goal was to filter the results on Graphite side not on my client. Again, I'm refering only to the HoltWinters special function, which need history for the calculation... – Tomer Peled May 30 '13 at 03:54
  • The problem is that you are looking for a minimum of 30min precision, when most Graphite systems are not configured to store that precision for a 30day period. That is why I suggested doing the parsing outside of Graphite. If you do have the precision though, you can just use maxDataPoints to limit the results you want to see. – Adam May 30 '13 at 06:47
  • I am not familiar with maxDataPoints, also I cannot find it on the documentation... – Tomer Peled May 30 '13 at 07:17
  • This should give you a good start - https://graphite.readthedocs.org/en/latest/render_api.html#maxdatapoints – Adam May 30 '13 at 08:22
  • On the maxDataPoints. It may not be in the version of graphite web you are on. See: https://github.com/graphite-project/graphite-web/pull/170 . Once you have it, you'll do this: graphite.whatever.net/render/?target=holtWintersConfidenceBands(stats.blah)&format=json&maxDataPoints=10 – Matt Self Jun 11 '13 at 17:57