Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.87 KB

README.md

File metadata and controls

60 lines (42 loc) · 1.87 KB

Heartcheck::Cache

Build Status Code Climate

##A plugin to check cache connection with heartcheck.

Installation

Add this line to your application's Gemfile:

gem 'heartcheck-cache'

And then execute:

$ bundle

Or install it yourself as:

$ gem install heartcheck-cache

Usage

You can check any cache connection that there's in your app. Each service need to respond to :name (an indetifier) and :connection (an activerecord connection)

Heartcheck.setup do |config|
  config.add :cache do |c|
    c.add_service(name: 'MyCacheConnection', connection: Dalli::Client.new('localhost:11211'))
  end
end

If you need check the Rails.cache this service need be added with dynamic service; The dynamic service is a Hash that needs to respond to :name to identify the service and :connection that is recommended to use the cache connection that your app is using. Ex.

Heartcheck.setup do |config|
  config.add :cache do |c|
    c.add_service(name: 'MyRailsCacheConnection', connection: Rails.cache.instance_variable_get("@data"))
  end
end

Check Heartcheck example here

License

Contributing

  1. Fork it ( https://github.com/locaweb/heartcheck-cache )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request