From 089b4dc651b7ccf82ea1dfdc50e72064d23ee396 Mon Sep 17 00:00:00 2001 From: luanhailiang Date: Fri, 22 Sep 2023 15:22:23 +0800 Subject: [PATCH] cProfile --- app.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app.py b/app.py index 662e88f..19c57d0 100644 --- a/app.py +++ b/app.py @@ -171,5 +171,19 @@ def post_request(url, data): response = requests.post(url, data=data,headers=headers) print(response.text) +# import pstats +# import cProfile +# def test_function(): +# url = "rtmp://rtmp03open.ys7.com:1935/v3/openlive/L05874022_1_1?expire=1726389273&id=625006970167889920&t=2c7f371063e4ad672cb7a7c34b2a236e9ff37b02052f818c9c4fe7ae9632cd0e&ev=100" +# gen = worker(0,url,5) +# count = 0 +# for data in gen: +# count += 1 +# if count > 10: +# break + if __name__ == '__main__': + # cProfile.run('test_function()', 'test_function.profile') + # p = pstats.Stats('test_function.profile') + # p.sort_stats('cumulative').print_stats(100) # Top 10 by cumulative time app.run("0.0.0.0",threaded=True)