From 8e3e6c9d9d5eceba20a8e3fc0810be61a3dcd83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Tue, 20 Feb 2024 15:46:40 +0100 Subject: [PATCH] labled proc times in time debug and added ann full proc time timer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/server/app.py b/server/app.py index e3cb618..8bf6ecd 100644 --- a/server/app.py +++ b/server/app.py @@ -110,14 +110,12 @@ def connect_mqtt(): return client def mqtt_publisher(ti_receiver): - start = time.time() # Create and start a thread for each universe mqtt_client = connect_mqtt() artnetBindIp = get_eth0_ip() artNet = Artnet.Artnet(BINDIP = artnetBindIp, DEBUG = True, SHORTNAME = "PiXelTubeMaster", LONGNAME = "PiXelTubeMaster", PORT = 6454) - end = time.time() - print("1 "+str(end-start)) while True: + start_alltimer = time.time() try: start = time.time() tube_index = ti_receiver.recv() @@ -125,20 +123,19 @@ def mqtt_publisher(ti_receiver): artNetPacket = artNet.readPacket() # Make sure we actually *have* a packet end = time.time() - print("2 "+str(end-start)) + print("Receiving of tube index and artnet packet took: "+str(end-start)) if artNetPacket is not None: start = time.time() #Checks to see if the current packet is for the specified DMX Universe dmxPacket = artNetPacket.data # Create MQTT topic based on the universe and channel end = time.time() - print("3 "+str(end-start)) + print("setting dmxPacket var from artnet data took: "+str(end-start)) if tube_index is not None: start = time.time() tube_index = literal_eval(tube_index) end = time.time() - print("4 "+str(end-start)) - start = time.time() + print("Converting tube index back to list wtih leval took: "+str(end-start)) for index_row in tube_index: start = time.time() if artNetPacket.universe == int(index_row[1]): @@ -155,13 +152,13 @@ def mqtt_publisher(ti_receiver): result = str(result_str) mqtt_client.publish(p1_topic, result) end = time.time() - print("5 "+str(end-start)) - end = time.time() - print("6 "+str(end-start)) + print("checking correct universe, converting list to specific pixel and publishing them took: "+str(end-start)) except KeyboardInterrupt: artNet.close() + end_alltimer = time.time() + print("6 "+str(end_alltimer-start_alltimer)) def tube_index_updater(ti_queue): while True: try: