[ADMIN_API] Adjusting worker messages

Changing PING back to STATS and STATS to METRICS to simplify deployments

Change-Id: I959f968a9a298c66b7e4fbfa6b6818acd95d8718
This commit is contained in:
Marc Pilon 2014-01-08 14:49:19 -05:00
parent f35ddd0b1d
commit 04b72659f4
4 changed files with 16 additions and 13 deletions

View File

@ -103,14 +103,14 @@ cfg.CONF.register_opts(
cfg.IntOpt('stats_freq',
metavar='MINUTES',
default=5,
help='Minutes between sending STATS requests to workers'),
help='Minutes between collecting usage statistics'),
cfg.BoolOpt('stats_purge_enable',
default=False,
help='Enable / Disable purging of usage statistics'),
cfg.IntOpt('stats_purge_days',
metavar='DAYS',
default=5,
help='Number of days to keep usage STATS before purging'),
help='Number of days to keep usage statistics'),
cfg.IntOpt('delete_timer_seconds',
default=5,
help='Which second of each minute delete timer should run'),
@ -119,7 +119,7 @@ cfg.CONF.register_opts(
help='Second of each minute ping timer should run'),
cfg.IntOpt('stats_timer_seconds',
default=20,
help='Second of each minute stats timer should run'),
help='Second of each minute statistics timer should run'),
cfg.IntOpt('usage_timer_seconds',
default=25,
help='Which second of each minute usage timer should run'),

View File

@ -47,7 +47,9 @@ class GearJobs(object):
failed_list = []
node_status = dict()
retry_list = []
job_data = {"hpcs_action": "PING"}
# The message name is STATS for historical reasons. Real
# data statistics are gathered with METRICS messages.
job_data = {"hpcs_action": "STATS"}
for node in node_list:
list_of_jobs.append(dict(task=str(node), data=job_data))
submitted_pings = self.gm_client.submit_multiple_jobs(
@ -150,7 +152,7 @@ class GearJobs(object):
failed_list = []
retry_list = []
results = {}
job_data = {"hpcs_action": "STATS"}
job_data = {"hpcs_action": "METRICS"}
for node in node_list:
list_of_jobs.append(dict(task=str(node), data=job_data))
submitted_stats = self.gm_client.submit_multiple_jobs(
@ -174,7 +176,8 @@ class GearJobs(object):
list_of_jobs = []
if len(retry_list) > 0:
LOG.info(
"{0} stats timed out, retrying".format(len(retry_list))
"{0} Statistics gathering timed out, retrying".
format(len(retry_list))
)
for node in retry_list:
list_of_jobs.append(dict(task=str(node), data=job_data))
@ -186,8 +189,8 @@ class GearJobs(object):
if stats.state == JOB_UNKNOWN:
# TODO: Gearman server failed, ignoring for now
LOG.error(
"Gearman Job server failed during STATS check of {0}".
format(stats.job.task)
"Gearman Job server failed gathering statistics "
"on {0}".format(stats.job.task)
)
failed_list.append(stats.job.task)
elif stats.timed_out:

View File

@ -182,13 +182,13 @@ class UsageStats(object):
data = self._get_lb(device_name, session)
if not data:
LOG.error(
'Device {0} has no Loadbalancer attached during STATS'.
format(device_name)
'Device {0} has no Loadbalancer attached during '
'statistics gathering'.format(device_name)
)
continue
LOG.error(
'Load balancer failed STATS request '
'Load balancer failed statistics gathering request '
'ID: {0}\n'
'IP: {1}\n'
'tenant: {2}\n'.format(

View File

@ -33,8 +33,8 @@ gearman_workers = [
'DELETE', # Delete a Load Balancer.
'DISCOVER', # Return service discovery information.
'ARCHIVE', # Archive LB log files.
'STATS', # Get load balancer statistics.
'PING' # Ping load balancers
'METRICS', # Get load balancer statistics.
'STATS' # Ping load balancers
]