summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2017-07-26 13:22:03 +0200
committerChristophe Matthieu <chm@odoo.com>2017-07-26 15:02:59 +0200
commit8fa7c68ca8a6e168e503aa0c217660551b998fff (patch)
tree630f98edabf743a42dbe35b1c2567794dcd138c1 /addons
parent4c6c16a38246727e3a32ba67b8aa3abd1aec6d5c (diff)
[IMP] tools: add a profiler for odoo performance analysis
Use ``profile`` to decorate an entry point method. If ``profile`` is used without params, log as shallow mode else log all methods for all odoo models by applying the optional filters. :param whitelist: None or list of model names to display in the log (Default: None) :type whitelist: list or None :param files: None or list of filenames to display in the log (Default: None) :type files: list or None :param list blacklist: list model names to remove from the log (Default: remove non odoo model from the log: [None]) :param int minimum_time: minimum time (ms) to display a method (Default: 0) :param int minimum_queries: minimum sql queries to display a method (Default: 0) .. code-block:: python from odoo.tools.profiler import profile class SaleOrder(models.Model): ... @api.model @profile # log only this create method def create(self, vals): ... @api.multi @profile() # log all methods for all odoo models def unlink(self): ... @profile(whitelist=['sale.order', 'ir.model.data']) def action_quotation_send(self): ... @profile(files=['/home/openerp/odoo/odoo/addons/sale/models/sale.py']) def write(self): ... NB: The use of the profiler modifies the execution time
Diffstat (limited to 'addons')
0 files changed, 0 insertions, 0 deletions