Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

[ADD] get_profile_stats: Add script to get cProfile stats #319

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moylop260
Copy link
Contributor

  • Allow detect top python method that waste many time or that is executed many times.
  • Add cProfile stats from odoo-profile module by @gracinet of anybox.fr
    • Vauxoo version add a version to get stats from all orm_method's when start and stop server with tests. More info here
    • Why use vauxoo/odoo-profiler instead of create a new oca/odoo-profiler?
      • I have created a question to @gracinet by twitter to migrate it to oca, but I don't have reply yet. (IMHO we can use it with this way).
  • Add a script to print stats in after_success script.
    • Ignore original python methods and odoo original methods.
  • Example of stats output:
Print cProfile sorted by index 0:
      4068       4068   0.012947   4.983248 ${HOME}/addons-vauxoo/stock_location_code/model/stock.py:83 _name_get
      1269       1269   0.005017   0.049808 ${HOME}/addons-vauxoo/sale_order_dates_max/models/sale.py:36 _get_commitment_date
       633        633   0.001206   0.032492 ${HOME}/addons-yelizariev/web_debranding/models/ir_translation.py:12 _debrand
       520        520   0.001079   0.162525 ${HOME}/addons-vauxoo/sale_team_warehouse/models/sales_team.py:21 default_get
Print cProfile sorted by index 3:
      4068       4068   0.012947   4.983248 ${HOME}/addons-vauxoo/stock_location_code/model/stock.py:83 _name_get
       520        520   0.001079   0.162525 ${HOME}/addons-vauxoo/sale_team_warehouse/models/sales_team.py:21 default_get
      1269       1269   0.005017   0.049808 ${HOME}/addons-vauxoo/sale_order_dates_max/models/sale.py:36 _get_commitment_date
       633        633   0.001206   0.032492 ${HOME}/addons-yelizariev/web_debranding/models/ir_translation.py:12 _debrand```

@moylop260 moylop260 self-assigned this Feb 20, 2016
@moylop260 moylop260 force-pushed the master-oca-profiling-moy branch 3 times, most recently from 6603cf0 to b501470 Compare February 20, 2016 07:55
@@ -0,0 +1,79 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add author and license please

@moylop260 moylop260 force-pushed the master-oca-profiling-moy branch 2 times, most recently from a7108a0 to abc9993 Compare February 24, 2016 08:24
@moylop260
Copy link
Contributor Author

@dreispt
Thanks for comments
I fixed them.

I added to main description of this PR the why use external repo non-oca for odoo-profiler.

@moylop260 moylop260 force-pushed the master-oca-profiling-moy branch from abc9993 to c8f45e8 Compare February 24, 2016 08:35
@petrus-v
Copy link

@moylop260 thanks for your interest to odoo-profiler module! I'm going to ask @gracinet directly and @jssuzanne I'm pretty sure they will be happy to see this module in oca repo!

Great idea to include it in OCA CI!

@petrus-v
Copy link

@moylop260,

I asked directly @gracinet and @jssuzanne to move odoo-profiler module under OCA! And as I was expected they are happy to share their works here.

Do you want Anybox to create the PR or prefer to do it yourself? What do you think, which OCA repo will fit this module?

@moylop260
Copy link
Contributor Author

We need that they sign the cla to include original commit and author in OCA from gtihub user.
Maybe we can use oca/server-tools

@moylop260
Copy link
Contributor Author

Thanks for the advice and make question to @gracinet

@petrus-v
Copy link

I think they already signed the CLA but I may be wrong.

@moylop260
Copy link
Contributor Author

I got it
I will create a new pr to server-tools and we can check it...
Thank you

@moylop260
Copy link
Contributor Author

@moylop260
Copy link
Contributor Author

Could we continue the revision of this PR?
The process of use a module of project oca is WIP here: OCA/server-tools#375
But we can get feedback of this PR, meanwhile.

@pedrobaeza pedrobaeza force-pushed the master branch 6 times, most recently from bd52b5c to 4cad6e5 Compare October 13, 2016 00:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants