Browse Source

Add logging for octavia stats collector

Change-Id: I64736b3347d050f4c1a542a3fb15efb2cf2f1e0c
changes/71/758671/1
asarfaty 3 months ago
committed by Adit Sarfaty
parent
commit
b3618d641a
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      vmware_nsx/services/lbaas/octavia/octavia_listener.py

+ 9
- 1
vmware_nsx/services/lbaas/octavia/octavia_listener.py View File

@ -677,6 +677,8 @@ class NSXOctaviaListenerEndpoint(object):
class NSXOctaviaStatisticsCollector(object):
def __init__(self, core_plugin, listener_stats_getter,
loadbalancer_status_getter=None):
LOG.info("NSXOctaviaStatisticsCollector starting with interval of "
"%s seconds", cfg.CONF.octavia_stats_interval)
self.core_plugin = core_plugin
self.listener_stats_getter = listener_stats_getter
self.loadbalancer_status_getter = loadbalancer_status_getter
@ -685,12 +687,18 @@ class NSXOctaviaStatisticsCollector(object):
cfg.CONF.octavia_stats_interval)
def thread_runner(self, interval):
LOG.info("NSXOctaviaStatisticsCollector thread_runner is running")
while True:
time.sleep(interval)
self.collect()
try:
self.collect()
except Exception as e:
LOG.error("Octavia stats collect failed with %s", e)
def collect(self):
if not self.core_plugin.octavia_listener:
LOG.warning("Octavia stats collector cannot run with plugin %s",
self.core_plugin)
return
endpoint = self.core_plugin.octavia_listener.endpoints[0]


Loading…
Cancel
Save