mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Merge pull request #66 from sschneid/hgetall_not_hget_in_a_loop
Use $redis.hgetall rather than hget in a loop
This commit is contained in:
commit
fa4147fb68
1 changed files with 2 additions and 2 deletions
|
|
@ -76,7 +76,7 @@ module Vmpooler
|
|||
task[:count][:pool] = {}
|
||||
task[:duration][:pool] = {}
|
||||
|
||||
$redis.hkeys('vmpooler__' + task_str + '__' + date_str).each do |key|
|
||||
$redis.hgetall('vmpooler__' + task_str + '__' + date_str).each do |key, value|
|
||||
pool = 'unknown'
|
||||
hostname = 'unknown'
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ module Vmpooler
|
|||
task[:duration][:pool][pool] ||= {}
|
||||
|
||||
task_times_bypool[pool] ||= []
|
||||
task_times_bypool[pool].push($redis.hget('vmpooler__' + task_str + '__' + date_str, key).to_f)
|
||||
task_times_bypool[pool].push(value.to_f)
|
||||
end
|
||||
|
||||
task_times_bypool.each_key do |pool|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue