Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/locaweb/heartcheck-cache
A plugin to check cache connection with heartcheck
https://github.com/locaweb/heartcheck-cache
hacktoberfest
Last synced: about 1 month ago
JSON representation
A plugin to check cache connection with heartcheck
- Host: GitHub
- URL: https://github.com/locaweb/heartcheck-cache
- Owner: locaweb
- License: mit
- Created: 2015-03-02T14:20:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-10-21T12:41:19.000Z (about 3 years ago)
- Last Synced: 2024-04-16T18:21:21.663Z (9 months ago)
- Topics: hacktoberfest
- Language: Ruby
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 19
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Heartcheck::Cache
[![Build Status](https://travis-ci.org/locaweb/heartcheck-cache.svg?branch=master)](https://travis-ci.org/locaweb/heartcheck-cache)
[![Code Climate](https://codeclimate.com/github/locaweb/heartcheck-cache/badges/gpa.svg)](https://codeclimate.com/github/locaweb/heartcheck-cache)##A plugin to check cache connection with [heartcheck](https://github.com/locaweb/heartcheck).
## Installation
Add this line to your application's Gemfile:
```ruby
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)```ruby
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.```ruby
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](https://github.com/locaweb/heartcheck/blob/master/lib/heartcheck/generators/templates/config.rb)
## License
* [MIT License](https://github.com/locaweb/heartcheck-cache/blob/master/LICENSE.txt)## 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