[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:
@@ -103,14 +103,14 @@ cfg.CONF.register_opts(
|
|||||||
cfg.IntOpt('stats_freq',
|
cfg.IntOpt('stats_freq',
|
||||||
metavar='MINUTES',
|
metavar='MINUTES',
|
||||||
default=5,
|
default=5,
|
||||||
help='Minutes between sending STATS requests to workers'),
|
help='Minutes between collecting usage statistics'),
|
||||||
cfg.BoolOpt('stats_purge_enable',
|
cfg.BoolOpt('stats_purge_enable',
|
||||||
default=False,
|
default=False,
|
||||||
help='Enable / Disable purging of usage statistics'),
|
help='Enable / Disable purging of usage statistics'),
|
||||||
cfg.IntOpt('stats_purge_days',
|
cfg.IntOpt('stats_purge_days',
|
||||||
metavar='DAYS',
|
metavar='DAYS',
|
||||||
default=5,
|
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',
|
cfg.IntOpt('delete_timer_seconds',
|
||||||
default=5,
|
default=5,
|
||||||
help='Which second of each minute delete timer should run'),
|
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'),
|
help='Second of each minute ping timer should run'),
|
||||||
cfg.IntOpt('stats_timer_seconds',
|
cfg.IntOpt('stats_timer_seconds',
|
||||||
default=20,
|
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',
|
cfg.IntOpt('usage_timer_seconds',
|
||||||
default=25,
|
default=25,
|
||||||
help='Which second of each minute usage timer should run'),
|
help='Which second of each minute usage timer should run'),
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ class GearJobs(object):
|
|||||||
failed_list = []
|
failed_list = []
|
||||||
node_status = dict()
|
node_status = dict()
|
||||||
retry_list = []
|
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:
|
for node in node_list:
|
||||||
list_of_jobs.append(dict(task=str(node), data=job_data))
|
list_of_jobs.append(dict(task=str(node), data=job_data))
|
||||||
submitted_pings = self.gm_client.submit_multiple_jobs(
|
submitted_pings = self.gm_client.submit_multiple_jobs(
|
||||||
@@ -150,7 +152,7 @@ class GearJobs(object):
|
|||||||
failed_list = []
|
failed_list = []
|
||||||
retry_list = []
|
retry_list = []
|
||||||
results = {}
|
results = {}
|
||||||
job_data = {"hpcs_action": "STATS"}
|
job_data = {"hpcs_action": "METRICS"}
|
||||||
for node in node_list:
|
for node in node_list:
|
||||||
list_of_jobs.append(dict(task=str(node), data=job_data))
|
list_of_jobs.append(dict(task=str(node), data=job_data))
|
||||||
submitted_stats = self.gm_client.submit_multiple_jobs(
|
submitted_stats = self.gm_client.submit_multiple_jobs(
|
||||||
@@ -174,7 +176,8 @@ class GearJobs(object):
|
|||||||
list_of_jobs = []
|
list_of_jobs = []
|
||||||
if len(retry_list) > 0:
|
if len(retry_list) > 0:
|
||||||
LOG.info(
|
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:
|
for node in retry_list:
|
||||||
list_of_jobs.append(dict(task=str(node), data=job_data))
|
list_of_jobs.append(dict(task=str(node), data=job_data))
|
||||||
@@ -186,8 +189,8 @@ class GearJobs(object):
|
|||||||
if stats.state == JOB_UNKNOWN:
|
if stats.state == JOB_UNKNOWN:
|
||||||
# TODO: Gearman server failed, ignoring for now
|
# TODO: Gearman server failed, ignoring for now
|
||||||
LOG.error(
|
LOG.error(
|
||||||
"Gearman Job server failed during STATS check of {0}".
|
"Gearman Job server failed gathering statistics "
|
||||||
format(stats.job.task)
|
"on {0}".format(stats.job.task)
|
||||||
)
|
)
|
||||||
failed_list.append(stats.job.task)
|
failed_list.append(stats.job.task)
|
||||||
elif stats.timed_out:
|
elif stats.timed_out:
|
||||||
|
|||||||
@@ -182,13 +182,13 @@ class UsageStats(object):
|
|||||||
data = self._get_lb(device_name, session)
|
data = self._get_lb(device_name, session)
|
||||||
if not data:
|
if not data:
|
||||||
LOG.error(
|
LOG.error(
|
||||||
'Device {0} has no Loadbalancer attached during STATS'.
|
'Device {0} has no Loadbalancer attached during '
|
||||||
format(device_name)
|
'statistics gathering'.format(device_name)
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
LOG.error(
|
LOG.error(
|
||||||
'Load balancer failed STATS request '
|
'Load balancer failed statistics gathering request '
|
||||||
'ID: {0}\n'
|
'ID: {0}\n'
|
||||||
'IP: {1}\n'
|
'IP: {1}\n'
|
||||||
'tenant: {2}\n'.format(
|
'tenant: {2}\n'.format(
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ gearman_workers = [
|
|||||||
'DELETE', # Delete a Load Balancer.
|
'DELETE', # Delete a Load Balancer.
|
||||||
'DISCOVER', # Return service discovery information.
|
'DISCOVER', # Return service discovery information.
|
||||||
'ARCHIVE', # Archive LB log files.
|
'ARCHIVE', # Archive LB log files.
|
||||||
'STATS', # Get load balancer statistics.
|
'METRICS', # Get load balancer statistics.
|
||||||
'PING' # Ping load balancers
|
'STATS' # Ping load balancers
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user