项目
在 GitHub 查看
jsuchal/garelic
关于
使用 Google Analytics 监控 Rails 应用的性能。
其他项目实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Garelic: Use Google Analytics as "New Relic" performance monitoring for your Rails app
This gem uses Google Analytics User Timing API to report application performance statistics directly to Google Analytics, where you can slice & dice your data as you wish.
Here are some features with pictures:
- Performance reports as a nice dashboard
- Histogram of response times for action
- Identify slow page loads & drill down to different actions
- Showing average response times for each action
- How much is spent in database & view generation for an action?
- How has the switch to Ruby 1.9.3 affected response time?
- In which action do we spent most time globaly?
- NEW (in 0.1.0) ActiveRecord queries drilldown
- NEW (in 0.2.0) Deployment performance comparison
Or look at these slides from a Garelic presentation.
Installation
It's easy as 1-2-3.
Step 1. Add this line to your application's Gemfile:
gem 'garelic'
Step 2. Add <%= Garelic.monitoring 'UA-XXXXXX-X' %> instrumentation in application layout template (before the closing </head> tag) like this:
<head>
<!-- other rails stuff -->
<%= Garelic.monitoring 'UA-XXXXXX-X' %>
<!-- make sure you remove your old GA code! -->
</head>
Step 3. Go to Google Analytics > Content > Site Speed > User Timings
Enjoy!
Known advantages
- it's free
- shows slow performing pages (not only actions)
- show response times histogram for any action (response time averages tend to lie, since distribution of response times is multimodal)
- segment/slice/dice response data across any dimensions available in your GA account
Known drawbacks
- you can only track actions that return a response body (redirects, ajax-requests & async jobs are not supported)
- all timings are visible in page source code (if you are concerned about this look elsewere)
- caching GA code (e.g. page caching) & not modified response will probably break/skew reported statistics
- adding user timing table widgets to GA dashboards does not preserve sorting order (wtf?)
- it's kind of a hack
TODO
- add support for adding custom user tracers (e.g. for external services)
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
探索相关项目
加载中…