removed cprofiler

Signed-off-by: Ebbe Baß <ebbe.bass>
main
Ebbe Baß 2024-02-19 16:55:16 +01:00
parent 12fd2b6b6e
commit 6927356998
1 changed files with 10 additions and 18 deletions

View File

@ -9,8 +9,6 @@ import time
from multiprocessing import Process, Pipe, Queue from multiprocessing import Process, Pipe, Queue
from queue import Empty from queue import Empty
from ast import literal_eval from ast import literal_eval
import cProfile
import pstats
app = Flask(__name__) app = Flask(__name__)
@ -172,19 +170,13 @@ def tube_index_collector(ti_queue, ti_sender):
ti_sender.send(None) ti_sender.send(None)
if __name__ == "__main__": if __name__ == "__main__":
with cProfile.Profile as profile: (ti_receiver,ti_sender) = Pipe(True)
try: ti_queue = Queue()
(ti_receiver,ti_sender) = Pipe(True) collector_thread = Process(target=tube_index_collector, args=(ti_queue, ti_sender, ))
ti_queue = Queue() collector_thread.start()
collector_thread = Process(target=tube_index_collector, args=(ti_queue, ti_sender, )) ti_updater_thread = Process(target=tube_index_updater, args=(ti_queue, ))
collector_thread.start() ti_updater_thread.start()
ti_updater_thread = Process(target=tube_index_updater, args=(ti_queue, )) publisher_thread = Process(target=mqtt_publisher, args=(ti_receiver, ))
ti_updater_thread.start() publisher_thread.start()
publisher_thread = Process(target=mqtt_publisher, args=(ti_receiver, )) flask_thread = Process(target=flask_api)
publisher_thread.start() flask_thread.start()
flask_thread = Process(target=flask_api)
flask_thread.start()
except KeyboardInterrupt:
result = pstats.Stats(profile)
result.sort_stats(pstats.SortKey.TIME)
result.print_stats()