(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:
John O'Connor 2020-06-25 19:44:26 +01:00
parent 8ed8c43970
commit a21d8c5642
14 changed files with 128 additions and 28 deletions

View file

@ -16,15 +16,15 @@ metrics = Vmpooler::Metrics.init(logger, config)
torun_threads = []
if ARGV.count == 0
torun = ['api', 'manager']
torun = %i[api manager]
else
torun = []
torun << 'api' if ARGV.include? 'api'
torun << 'manager' if ARGV.include? 'manager'
torun << :api if ARGV.include? 'api'
torun << :manager if ARGV.include? 'manager'
exit(2) if torun.empty?
end
if torun.include? 'api'
if torun.include? :api
api = Thread.new do
redis = Vmpooler.new_redis(redis_host, redis_port, redis_password)
Vmpooler::API.execute(torun, config, redis, metrics)
@ -38,7 +38,7 @@ elsif metrics.respond_to?(:setup_prometheus_metrics)
torun_threads << prometheus_only_api
end
if torun.include? 'manager'
if torun.include? :manager
manager = Thread.new do
Vmpooler::PoolManager.new(
config,