Changeset - 0bb7b9df12e5
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 7 years ago 2018-06-08 03:35:30
drewp@bigasterisk.com
collector warnings and errors. the reactor.crash isn't working.
Ignore-this: b7d4a6c08f04c924ffba6112483f9c19
2 files changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
bin/collector
Show inline comments
 
@@ -143,14 +143,14 @@ def launch(graph, doLoadTest=False):
 
        # todo: drive outputs with config files
 
        outputs = [
 
            # EnttecDmx(L9['output/dmx0/'], '/dev/dmx3', 80),
 
            Udmx(L9['output/dmxA/'], bus=4, numChannels=80),
 
            Udmx(L9['output/dmxB/'], bus=5, numChannels=510),
 
        ]
 
    except Exception as e:
 
        log.error("setting up outputs: %r", e)
 
    except Exception:
 
        log.error("setting up outputs:")
 
        traceback.print_exc()
 
        raise
 
    listeners = WebListeners()
 
    c = Collector(graph, outputs, listeners)
 

	
 
    startZmq(networking.collectorZmq.port, c)
 
@@ -189,11 +189,11 @@ def main():
 
    log.setLevel(logging.DEBUG if options.verbose else logging.INFO)
 

	
 
    logging.getLogger('colormath').setLevel(logging.INFO)
 
    
 
    graph = SyncedGraph(networking.rdfdb.url, "collector")
 

	
 
    graph.initiallySynced.addCallback(lambda _: launch(graph, options.loadtest)).addErrback(log.error)
 
    graph.initiallySynced.addCallback(lambda _: launch(graph, options.loadtest)).addErrback(lambda e: reactor.crash())
 
    reactor.run()
 

	
 
if __name__ == '__main__':
 
    main()
light9/collector/collector.py
Show inline comments
 
@@ -100,13 +100,14 @@ class Collector(Generic[ClientType, Clie
 
            else:
 
                out[(d, da)] = v
 
        return out
 

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

	
 
    def _merge(self, lastRequests):
 
        deviceAttrs = {} # device: {deviceAttr: value}       
 
        for _, lastSettings in lastRequests:
0 comments (0 inline, 0 general)