开发者

rails activerecord statistics/trends/time-series graph data

开发者 https://www.devze.com 2023-03-16 08:22 出处:网络
We are in the process of building dashboards for users where in they can see the trends/time series graphs of various activerecords; take a blogging site as an example. There are posts, each post has

We are in the process of building dashboards for users where in they can see the trends/time series graphs of various activerecords; take a blogging site as an example. There are posts, each post has many comments and tags. There are 2 kinds of dashboards to be built.

a. trend graphs
b. time series graphs

trends graphs:

example, trendin开发者_运维技巧g tags ( top 10, with # of posts), the ui looks like this

today [week] [month]
ruby-on-rails(20)
activerecord(10)
java(5)

When the user click on week, the trend shows the weekly data and so on. And similarly, another trend graph is top 10 posts with highest # of comments

time series graphs:

for example, time vs # of posts, over a period of 24 hours, 1 week, 1 month etc.,

        30
    20  |
10  |   |   10
|   |   |   |
t1  t2  t3  t4

a visual example

Secondary Requirement: The time series graphs cane be interactive and we may want show the actual data or additional series when a point is selected. Additional series: for example when the user selects point (t3,30) we want to show the tag name vs #count data.

ruby-on-rails(15) 
activerecord(10)
java(5)

I have looked at statistics gem and it is good for generating counts but not graph data.

Question Is there a gem(framework) to generate data for these graphs?. In our case, the graph data can be cached and refreshed every 15/30 minutes.


Is there any reason why you need a gem? A place that I've worked used Highcharts in combination with Ruby/Rails and that worked. You could also use the Google Chart API. I'm not sure how much you want to build out what you're doing, but you can create tables in a sql database that track whatever you want to be tracking, and then just feed those to the charting tool

Also, here are several services with API's that offer this kind of graphing capability.

StatsMix, Metricly, myDials, KPI Dashboard, and more

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号