Sha256: ca019796d4a0bf4b53f4817c22e61f630903641e1be76384203f7fd657bc7d0b

Contents?: true

Size: 546 Bytes

Versions: 1

Compression:

Stored size: 546 Bytes

Contents

module Hcheck
  module Checks
    # memcached check module
    # implements status
    # include memcached check dependencies
    module Memcached
      # @config { hosts, user, password }
      def status(config)
        client = Dalli::Client.new(config.delete(:url), config)
        client.get('_')
        'ok'
      rescue Dalli::RingError => e
        Hcheck.logger.error "[HCheck] Memcached::Error::NoServerAvailable #{e.message}"
        'bad'
      end

      def self.included(_base)
        require 'dalli'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hcheck-0.1.0 lib/hcheck/checks/memcached.rb