RDB (custom storage) support
Hi there.
Now I'm doing support for supply points values from relational database.
The database stores just timestamps of some events. Now I aggregate them to points with SQL-query like
"SELECT COUNT( * ) AS point_value, MAX( time ) AS time FROM `Events` WHERE `time` BETWEEN '2012-05-01 00:00:00' AND 2012-06-01 00:00:00' GROUP BY EXTRACT( DAY FROM TIME ) ORDER BY `time`"
where `time` column is column with timestamps. I also fill zero-fields (days when was not events) with zeroes in code. So I get a list of points (sum of events per day) and some step (a day in this case) and it works.
But! But this way is not universal. First of all I need to determine the step manually and I need to edit mysql query for each period (minutes, hours, days, years).
So I have a question: what is the best way to determine which step (secondsPerPoint) should be used and maybe graphite/
Also now I think that maybe graphite can make point's value for a hour from every-minute-point? If it is right, then another things will be very simple. You can just select from database with "GROUP BY EXTRACT( MINUTE FROM TIME )" and give it to some function witch gives you pointValues with a hour step.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Graphite Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Michael Leinartas
- Solved:
- Last query:
- Last reply: