class Sidekiq::Metrics::Query

def self.bkt_time_s(time, granularity)

def self.bkt_time_s(time, granularity)
  # truncate time to ten minutes ("8:40", not "8:43") or one minute
  truncation = (granularity == :hourly) ? 600 : 60
  Time.at(time.to_i - time.to_i % truncation).utc.iso8601
end