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?
Deze vraag is gerapporteerd
1
Beantwoorden
1050
Weergaven
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
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden