mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
Use 'date_str' instead of 'date'
This commit is contained in:
parent
5453ec6206
commit
35e78aacb5
1 changed files with 5 additions and 5 deletions
|
|
@ -26,7 +26,7 @@ module Vmpooler
|
||||||
capacity
|
capacity
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_clone_metrics(date)
|
def get_clone_metrics(date_str)
|
||||||
clone = {
|
clone = {
|
||||||
duration: {
|
duration: {
|
||||||
average: 0,
|
average: 0,
|
||||||
|
|
@ -39,10 +39,10 @@ module Vmpooler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clone[:count][:total] = $redis.hlen('vmpooler__clone__' + date).to_i
|
clone[:count][:total] = $redis.hlen('vmpooler__clone__' + date_str).to_i
|
||||||
|
|
||||||
if clone[:count][:total] > 0
|
if clone[:count][:total] > 0
|
||||||
clone_times = get_clone_times(date)
|
clone_times = get_clone_times(date_str)
|
||||||
|
|
||||||
clone[:duration][:total] = clone_times.reduce(:+).to_f
|
clone[:duration][:total] = clone_times.reduce(:+).to_f
|
||||||
clone[:duration][:average] = (clone[:duration][:total] / clone[:count][:total]).round(1)
|
clone[:duration][:average] = (clone[:duration][:total] / clone[:count][:total]).round(1)
|
||||||
|
|
@ -52,8 +52,8 @@ module Vmpooler
|
||||||
clone
|
clone
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_clone_times(date)
|
def get_clone_times(date_str)
|
||||||
$redis.hvals('vmpooler__clone__' + date.to_s).map(&:to_f)
|
$redis.hvals('vmpooler__clone__' + date_str).map(&:to_f)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_queue_metrics()
|
def get_queue_metrics()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue