I know Odoo from version 15 has implemented profiling from the UI. is there any way to use profiling on the functions with @profile decorator?
Pertanyaan ini telah diberikan tanda
1
Balas
1042
Tampilan
Hi,
You can use `import cProfile` to import cProfile tool and then
def you_func(self):
pr = cProfile.Profile()
pr.enable()
# you logic
pr.disable()
pr.print_stats(sort='ncalls')
Now in your Run window you can see the stats and profile your function. You can use the `sort` parameter to sort your result.
Hope it helps
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar