<commit_before># Heartcheck::Cache

A plugin to check cache connection with 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 add a check to cache when configure the heartcheck

```ruby
Heartcheck.setup do |config|
  config.add :cache do |c|
    c.add_service(name: 'MyCacheConnection', connection: Cache.new)
  end
end
```

The 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: 'MyCacheConnection', connection: Dalli::Client.new('localhost:11211'))
  end
end
```

## Contributing

1. Fork it ( https://github.com/locaweb/heartcheck-redis )
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<commit_msg>Show how to use the app's cache<commit_after># Heartcheck::Cache

A plugin to check cache connection with 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 add a check to cache when configure the heartcheck

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

The 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: 'MyCacheConnection', connection: Rails.cache.instance_variable_get("@data"))
  end
end
```

## Contributing

1. Fork it ( https://github.com/locaweb/heartcheck-redis )
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
{'fraction_non_alphanumeric': 0.10609288453344695, 'fraction_numerical': 0.008521516829995739, 'mean_word_length': 4.241071428571429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5023117', 'n_tokens_mistral': 753, 'n_tokens_neox': 704, 'n_words': 291}