]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard_v2: add more debug message to tools.py
authorRicardo Dias <rdias@suse.com>
Thu, 8 Feb 2018 08:23:03 +0000 (08:23 +0000)
committerRicardo Dias <rdias@suse.com>
Mon, 5 Mar 2018 13:07:06 +0000 (13:07 +0000)
Signed-off-by: Ricardo Dias <rdias@suse.com>
src/pybind/mgr/dashboard_v2/tools.py

index 65c4e96eb3566071bc80acf0ef36dacf893d1105..8bf5034d772e19998c3a69fea36f4d6782fa60d1 100644 (file)
@@ -14,6 +14,8 @@ import threading
 import six
 import cherrypy
 
+from . import logger
+
 
 def ApiController(path):
     def decorate(cls):
@@ -290,6 +292,7 @@ class SessionExpireAtBrowserCloseTool(cherrypy.Tool):
         # Shall the cookie expire at browser close?
         expire_at_browser_close = cherrypy.session.get(
             Session.EXPIRE_AT_BROWSER_CLOSE, True)
+        logger.debug("expire at browser close: %s", expire_at_browser_close)
         if expire_at_browser_close:
             # Get the cookie and its name.
             cookie = cherrypy.response.cookie
@@ -297,6 +300,7 @@ class SessionExpireAtBrowserCloseTool(cherrypy.Tool):
                 'tools.sessions.name', Session.NAME)
             # Make the cookie a session cookie by purging the
             # fields 'expires' and 'max-age'.
+            logger.debug("expire at browser close: removing 'expires' and 'max-age'")
             if name in cookie:
                 del cookie[name]['expires']
                 del cookie[name]['max-age']
@@ -322,6 +326,7 @@ class NotificationQueue(threading.Thread):
                 return
             cls._running = True
             cls._instance = NotificationQueue()
+        logger.debug("starting notification queue")
         cls._instance.start()
 
     @classmethod
@@ -335,7 +340,9 @@ class NotificationQueue(threading.Thread):
             cls._running = False
         with cls._cond:
             cls._cond.notify()
+        logger.debug("waiting for notification queue to finish")
         instance.join()
+        logger.debug("notification queue stopped")
 
     @classmethod
     def register(cls, func, types=None):
@@ -377,8 +384,10 @@ class NotificationQueue(threading.Thread):
                 listener(notify_value)
 
     def run(self):
+        logger.debug("notification queue started")
         while self._running:
             private_buffer = []
+            logger.debug("NQ: processing queue: %s", len(self._queue))
             try:
                 while True:
                     private_buffer.append(self._queue.popleft())
@@ -388,5 +397,7 @@ class NotificationQueue(threading.Thread):
             with self._cond:
                 self._cond.wait(1.0)
         # flush remaining events
+        logger.debug("NQ: flush remaining events: %s", len(self._queue))
         self.notify_listeners(self._queue)
         self._queue.clear()
+        logger.debug("notification queue finished")