'statistics:increment'
instance, stats
14 15 16 17 18 19 20
# File 'lib/micro_q/statistics/redis.rb', line 14 def incr(*keys) MicroQ.redis do |r| r.pipelined { keys.flatten.each do |key| r.hincrby(INCR, key, 1) end } end end
6 7 8 9 10 11 12
# File 'lib/micro_q/statistics/redis.rb', line 6 def increment MicroQ.redis do |r| r.hgetall(INCR) end.each_with_object({}) do |(k, v), hash| hash[k] = v.to_i end end