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?
Cette question a été signalée
1
Répondre
1051
Vues
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
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire