You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.8 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ========
  5. Profiler
  6. ========
  7. Integration of cProfile and PgBadger.
  8. Installation
  9. ============
  10. To install this module, you need the following requirements:
  11. * Install `pgbadger <http://dalibo.github.io/pgbadger/>`_ binary package.
  12. * Install `pstats_print2list <https://pypi.python.org/pypi/pstats_print2list>`_ python package.
  13. * Set `PG_LOG_PATH` environment variable to know location of the `postgresql.log` file by default is `/var/lib/postgresql/9.X/main/pg_log/postgresql.log`
  14. * Enable postgresql logs from postgresql's configuration file (Default location for Linux Debian is `/etc/postgresql/*/main/postgresql.conf`)
  15. - Add the following lines at final (A postgresql restart is required `/etc/init.d/postgresql restart`)
  16. .. code-block:: text
  17. logging_collector=on
  18. log_destination='stderr'
  19. log_directory='pg_log'
  20. log_filename='postgresql.log'
  21. log_rotation_age=0
  22. log_checkpoints=on
  23. log_hostname=on
  24. log_line_prefix='%t [%p]: [%l-1] db=%d,user=%u '
  25. Configuration
  26. =============
  27. By default profiler module adds two system parameters
  28. - exclude_fnames > '/.repo_requirements,~/odoo-8.0,/usr/,>'
  29. - exclude_query > 'ir_translation'.
  30. These parameters can be configurated in order to exclude some outputs from
  31. profiling stats or pgbadger output.
  32. Usage
  33. =====
  34. After installation, a player is add on the header bar, with following buttons:
  35. - .. figure:: static/description/player.png
  36. :alt: Player to manage profiler
  37. * Start profiling
  38. - .. figure:: static/description/start_profiling.png
  39. :alt: Start profiling
  40. :height: 35px
  41. * Stop profiling
  42. - .. figure:: static/description/stop_profiling.png
  43. :alt: Stop profiling
  44. :height: 35px
  45. * Download stats: download stats file
  46. - .. figure:: static/description/dump_stats.png
  47. :alt: Download cprofile stats file
  48. :height: 35px
  49. * Clear stats
  50. - .. figure:: static/description/clear_stats.png
  51. :alt: Clear and remove stats file
  52. :height: 35px
  53. Credits
  54. =======
  55. Contributors
  56. ------------
  57. * Georges Racinet <gracinet@anybox.fr>
  58. - Remotely inspired from ZopeProfiler, although there is no online visualisation and there may never be one.
  59. * Moisés López <moylop260@vauxoo.com>
  60. * Hugo Adan <hugo@vauxoo.com>
  61. Maintainer
  62. ----------
  63. .. image:: https://odoo-community.org/logo.png
  64. :alt: Odoo Community Association
  65. :target: https://odoo-community.org
  66. This module is maintained by the OCA.
  67. OCA, or the Odoo Community Association, is a nonprofit organization whose
  68. mission is to support the collaborative development of Odoo features and
  69. promote its widespread use.
  70. To contribute to this module, please visit https://odoo-community.org.