class Concurrent::Utility::ProcessorCounter

def available_processor_count

def available_processor_count
  cpu_count = processor_count.to_f
  quota = cpu_quota
  return cpu_count if quota.nil?
  # cgroup cpus quotas have no limits, so they can be set to higher than the
  # real count of cores.
  if quota > cpu_count
    cpu_count
  else
    quota
  end
end