class ResqueAdmin::DataStore::StatsAccess

Public Class Methods

new(redis) click to toggle source
# File lib/resque_admin/data_store.rb, line 305
def initialize(redis)
  @redis = redis
end

Public Instance Methods

clear_stat(stat) click to toggle source
# File lib/resque_admin/data_store.rb, line 320
def clear_stat(stat)
  @redis.del("stat:#{stat}")
end
decremet_stat(stat, by = 1) click to toggle source
# File lib/resque_admin/data_store.rb, line 316
def decremet_stat(stat, by = 1)
  @redis.decrby("stat:#{stat}", by)
end
increment_stat(stat, by = 1) click to toggle source
# File lib/resque_admin/data_store.rb, line 312
def increment_stat(stat, by = 1)
  @redis.incrby("stat:#{stat}", by)
end
stat(stat) click to toggle source
# File lib/resque_admin/data_store.rb, line 308
def stat(stat)
  @redis.get("stat:#{stat}").to_i
end