Rubik is a gem to track realtime quantitive metrics such as the average duration of a method executed. Rubik is not suitable for long term metric collection since it
Add this line to your application's Gemfile:
gem 'rubik', git: '[email protected]:matrushka/rubik.git'
And then execute:
$ bundle
There are 2 options for configuration.
You can set the redis server by using the class method "redis=".
Rubik.redis = Redis.new
Rubik uses the global $redis variable if the redis server is not set with the class method.
$redis = Redis.new
Rubik can track instance method execution times easily.
class MyClass
include Rubik
track_method :run
def run
sleep 1
end
end
Just use the Rubik.push_metric method to push your custom metric.
Rubik.push_metric 'my-metric-name', value
Add slim to your Gemfile
gem 'slim'
Add the following to your "config/routes.rb"
require 'rubik/server'
mount Rubik::Server => '/rubik'
And then you can use the mounted route to see the monitoring dashboard.
Prepare a Gemfile for the standalone version
gem 'rubik', git: '[email protected]:matrushka/rubik.git'
gem 'slim'
Fill the config.ru file for booting Rubik::Server in your choice of Rack Server
require 'rubik/server'
Rubik.redis = Redis.new
run Rubik::Server.new
- Complete the test suit
- Optimize the Rubik.query method
- Complete docs
- Implement a configruation system for changing sample size
- Calculate estimated size of a full metric in Redis for docs
- Think about a way to group metrics and split them into seperate dashboards
- Consider using bitmaps instead of lua and sets (http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/ )
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request