[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r23420: {arm} change: including a log message when redrawing the log panel (in arm/trunk: . src src/interface)



Author: atagar
Date: 2010-10-06 15:13:54 +0000 (Wed, 06 Oct 2010)
New Revision: 23420

Modified:
   arm/trunk/TODO
   arm/trunk/src/armrc.defaults
   arm/trunk/src/interface/logPanel.py
Log:
change: including a log message when redrawing the log panel with the corrected content height



Modified: arm/trunk/TODO
===================================================================
--- arm/trunk/TODO	2010-10-06 12:52:54 UTC (rev 23419)
+++ arm/trunk/TODO	2010-10-06 15:13:54 UTC (rev 23420)
@@ -50,6 +50,7 @@
         - country data for client connections (requested by ioerror)
         - allow arm to resume after restarting tor
             This requires a full move to the torTools controller.
+        - provide measurements for startup time, and try improving bottlenecks
   [ ] setup scripts for arm
       [ ] updater (checks for a new tarball and installs it automatically)
       [ ] look into CAPs to get around permission issues for connection

Modified: arm/trunk/src/armrc.defaults
===================================================================
--- arm/trunk/src/armrc.defaults	2010-10-06 12:52:54 UTC (rev 23419)
+++ arm/trunk/src/armrc.defaults	2010-10-06 15:13:54 UTC (rev 23420)
@@ -147,6 +147,7 @@
 log.logPanel.prepopulateFailed WARN
 log.logPanel.logFileOpened NOTICE
 log.logPanel.logFileWriteFailed ERR
+log.logPanel.forceDoubleRedraw DEBUG
 log.connLookupFailed INFO
 log.connLookupFailover NOTICE
 log.connLookupAbandon WARN
@@ -180,6 +181,8 @@
 # [ARM_DEBUG] refresh rate: 0.001 seconds
 # [ARM_DEBUG] system call: ps -p 2354 -o %cpu,rss,%mem,etime (runtime: 0.02)
 # [ARM_DEBUG] system call: netstat -npt | grep 2354/tor (runtime: 0.02)
+# [ARM_DEBUG] recreating panel 'graph' with the dimensions of 14/124
+# [ARM_DEBUG] redrawing the log panel with the corrected content height (estimat was off by 4)
 # [ARM_DEBUG] GETINFO accounting/bytes-left (runtime: 0.0006)
 
 msg.BW READ:
@@ -193,6 +196,8 @@
 msg.ARM_DEBUG refresh rate:
 msg.ARM_DEBUG system call: ps
 msg.ARM_DEBUG system call: netstat
+msg.ARM_DEBUG recreating panel '
+msg.ARM_DEBUG redrawing the log panel with the corrected content height (
 msg.ARM_DEBUG GETINFO accounting/bytes
 msg.ARM_DEBUG GETINFO accounting/bytes-left
 msg.ARM_DEBUG GETINFO accounting/interval-end

Modified: arm/trunk/src/interface/logPanel.py
===================================================================
--- arm/trunk/src/interface/logPanel.py	2010-10-06 12:52:54 UTC (rev 23419)
+++ arm/trunk/src/interface/logPanel.py	2010-10-06 15:13:54 UTC (rev 23420)
@@ -51,7 +51,8 @@
                   "log.logPanel.prepopulateSuccess": log.INFO,
                   "log.logPanel.prepopulateFailed": log.WARN,
                   "log.logPanel.logFileOpened": log.NOTICE,
-                  "log.logPanel.logFileWriteFailed": log.ERR}
+                  "log.logPanel.logFileWriteFailed": log.ERR,
+                  "log.logPanel.forceDoubleRedraw": log.DEBUG}
 
 DUPLICATE_MSG = " [%i duplicate%s hidden]"
 
@@ -875,11 +876,21 @@
     # - lastContentHeight was off by too much
     # - we're off the bottom of the page
     newContentHeight = lineCount + self.scroll - 1
-    forceRedraw = abs(self.lastContentHeight - newContentHeight) >= CONTENT_HEIGHT_REDRAW_THRESHOLD
-    forceRedraw |= newContentHeight > height and self.scroll + height - 1 > newContentHeight
+    contentHeightDelta = abs(self.lastContentHeight - newContentHeight)
+    forceRedraw, forceRedrawReason = False, ""
     
+    if contentHeightDelta >= CONTENT_HEIGHT_REDRAW_THRESHOLD:
+      forceRedraw = True
+      forceRedrawReason = "estimate was off by %i" % contentHeightDelta
+    elif newContentHeight > height and self.scroll + height - 1 > newContentHeight:
+      forceRedraw = True
+      forceRedrawReason = "scrolled off the bottom of the page"
+    
     self.lastContentHeight = newContentHeight
-    if forceRedraw: self.redraw(True)
+    if forceRedraw:
+      forceRedrawReason = "redrawing the log panel with the corrected content height (%s)" % forceRedrawReason
+      log.log(self._config["log.logPanel.forceDoubleRedraw"], forceRedrawReason)
+      self.redraw(True)
     
     self.valsLock.release()