Changeset - e22c7d15a504
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-05-23 21:44:54
drewp@bigasterisk.com
logging fix
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/collector/collector.py
Show inline comments
 
@@ -130,19 +130,19 @@ class Collector:
 

	
 
        deviceAttrs = self._merge(iter(self.lastRequest.values()))
 

	
 
        outputAttrsByDevice = self._convertToOutputAttrsPerDevice(deviceAttrs)
 
        pendingOut = self._flattenDmxOutput(outputAttrsByDevice)
 

	
 
        dt1 = time.time() - now
 
        t2 = time.time()
 

	
 
        self._updateOutputs(pendingOut)
 

	
 
        dt2 = time.time() - dt1
 
        if dt1 > .030 or dt2 > .030:
 
            log.warning("slow setAttrs: prepare %.1fms -> updateOutputs %.1fms" % (dt1 * 1000, dt2 * 1000))
 
        t3 = time.time()
 
        if t2 - now > .030 or t3 - t2 > .030:
 
            log.warning("slow setAttrs: prepare %.1fms -> updateOutputs %.1fms" % ((t2 - now) * 1000, (t3 - t2) * 1000))
 

	
 
    def _warnOnLateRequests(self, client, now, sendTime):
 
        requestLag = now - sendTime
 
        if requestLag > .1 and now > self._initTime + 10 and getattr(self, '_lastWarnTime', 0) < now - 3:
 
            self._lastWarnTime = now
 
            log.warning('collector.setAttrs from %s is running %.1fms after the request was made', client, requestLag * 1000)
0 comments (0 inline, 0 general)