Sha256: 54881d81c60b9f7079db2b0ba6ff3223dc852865ef444b4c7ae208efe643ddd2
Contents?: true
Size: 806 Bytes
Versions: 1
Compression:
Stored size: 806 Bytes
Contents
require 'redis' require 'errors/errors' require 'modules/performance_stats' require 'forwardable' module RedisMonitor class Backend extend SingleForwardable def_delegators :redis, :get, :set, :info, :keys, :dbsize, :monitor def self.config(arguments) @@host = arguments[:redis_host] @@port = arguments[:redis_port] end def self.host @@host end def self.port @@port end def self.redis @@redis ||= Redis.new(:host => host, :port => port) end def self.performance_stats PerformanceStats.new(self).results end def self.search(key) keys(key).map{|found| {key: found, value: get(found)} } end def self.del(key) redis.del(key) if Authorization.authorized_for?(:remove_content) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
redis_monitor-0.0.6 | lib/modules/backend.rb |