mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
(POOLER-178) Target Stats for api & manager
Ensure that the correct stats are registered for the Manager and the api respectively. E.g. all checkout counters are for the api only, whereas clone times belong to the manager. Also new ondemand functionality stats weren't registered, so add these along with missing delete stats.
This commit is contained in:
parent
8ed8c43970
commit
a21d8c5642
14 changed files with 128 additions and 28 deletions
|
|
@ -339,7 +339,7 @@ module Vmpooler
|
|||
payload&.each do |poolname, count|
|
||||
next unless count.to_i > config['max_ondemand_instances_per_request']
|
||||
|
||||
metrics.increment('ondemandrequest.toomanyrequests.' + poolname)
|
||||
metrics.increment('ondemandrequest_fail.toomanyrequests.' + poolname)
|
||||
return true
|
||||
end
|
||||
false
|
||||
|
|
@ -363,7 +363,7 @@ module Vmpooler
|
|||
if backend.exists?("vmpooler__odrequest__#{request_id}")
|
||||
result['message'] = "request_id '#{request_id}' has already been created"
|
||||
status 409
|
||||
metrics.increment('ondemandrequest.generate.duplicaterequests')
|
||||
metrics.increment('ondemandrequest_generate.duplicaterequests')
|
||||
return result
|
||||
end
|
||||
|
||||
|
|
@ -387,7 +387,7 @@ module Vmpooler
|
|||
|
||||
result['domain'] = config['domain'] if config['domain']
|
||||
result[:ok] = true
|
||||
metrics.increment('ondemandrequest.generate.success')
|
||||
metrics.increment('ondemandrequest_generate.success')
|
||||
result
|
||||
end
|
||||
|
||||
|
|
@ -825,12 +825,12 @@ module Vmpooler
|
|||
else
|
||||
result[:bad_templates] = invalid
|
||||
invalid.each do |bad_template|
|
||||
metrics.increment('ondemandrequest.invalid.' + bad_template)
|
||||
metrics.increment('ondemandrequest_fail.invalid.' + bad_template)
|
||||
end
|
||||
status 404
|
||||
end
|
||||
else
|
||||
metrics.increment('ondemandrequest.invalid.unknown')
|
||||
metrics.increment('ondemandrequest_fail.invalid.unknown')
|
||||
status 404
|
||||
end
|
||||
rescue JSON::ParserError
|
||||
|
|
@ -860,12 +860,12 @@ module Vmpooler
|
|||
else
|
||||
result[:bad_templates] = invalid
|
||||
invalid.each do |bad_template|
|
||||
metrics.increment('ondemandrequest.invalid.' + bad_template)
|
||||
metrics.increment('ondemandrequest_fail.invalid.' + bad_template)
|
||||
end
|
||||
status 404
|
||||
end
|
||||
else
|
||||
metrics.increment('ondemandrequest.invalid.unknown')
|
||||
metrics.increment('ondemandrequest_fail.invalid.unknown')
|
||||
status 404
|
||||
end
|
||||
|
||||
|
|
@ -1154,8 +1154,9 @@ module Vmpooler
|
|||
|
||||
status 200
|
||||
result['ok'] = true
|
||||
metrics.increment('delete.success')
|
||||
else
|
||||
metrics.increment('delete.srem.failed')
|
||||
metrics.increment('delete.failed')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue