module Resque::Plugins::JobStats::Timeseries::Common

Constants

FACTOR
TIME_FORMAT

Public Instance Methods

timestamp() click to toggle source

A timestamp rounded to the lowest minute

# File lib/resque/plugins/job_stats/timeseries.rb, line 13
def timestamp
  time = Time.now.utc
  Time.at(time.to_i - time.sec).utc   # to_i removes usecs
end

Private Instance Methods

increx(key, ttl) click to toggle source

Increments a key and sets its expiry time

# File lib/resque/plugins/job_stats/timeseries.rb, line 49
def increx(key, ttl)
  Resque.redis.incr(key)
  Resque.redis.expire(key, ttl)
end