module RRRSpec::TasksetEstimation

Public Class Methods

estimate_secs(taskset_class) click to toggle source

Public: Return the cache on the estimated execution time of the specs.

Returns a hash of spec_file to estimate_sec

# File lib/rrrspec/redis_models.rb, line 1041
def self.estimate_secs(taskset_class)
  h = RRRSpec.redis.hgetall(RRRSpec.make_key('rrrspec', 'estimate_sec', taskset_class))
  estimate_secs = {}
  h.each do |spec_file, estimate_sec|
    estimate_secs[spec_file] = estimate_sec.to_i
  end
  return estimate_secs
end
update_estimate_secs(taskset_class, estimation) click to toggle source

Public: Update the estimation.

The estimation argument should be a hash like {“spec_file” => 20}.

# File lib/rrrspec/redis_models.rb, line 1053
def self.update_estimate_secs(taskset_class, estimation)
  return if estimation.empty?
  key = RRRSpec.make_key('rrrspec', 'estimate_sec', taskset_class)
  RRRSpec.redis.hmset(key, *estimation.to_a.flatten)
end