{"id":13467954,"url":"https://github.com/CFMTech/pytest-monitor","last_synced_at":"2025-03-26T03:31:20.143Z","repository":{"id":40248546,"uuid":"238016177","full_name":"CFMTech/pytest-monitor","owner":"CFMTech","description":"Pytest plugin for analyzing resource usage during test sessions","archived":false,"fork":false,"pushed_at":"2024-07-15T13:58:20.000Z","size":175,"stargazers_count":179,"open_issues_count":16,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-21T09:11:24.829Z","etag":null,"topics":["cpu-monitoring","integration-testing","memory-monitoring","pytest","pytest-plugin","python","qatools","quality"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CFMTech.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-03T16:59:38.000Z","updated_at":"2025-02-02T22:20:01.000Z","dependencies_parsed_at":"2024-06-18T17:11:08.892Z","dependency_job_id":"a6c8bc05-0467-4f88-8330-86edd8bd7da6","html_url":"https://github.com/CFMTech/pytest-monitor","commit_stats":{"total_commits":98,"total_committers":12,"mean_commits":8.166666666666666,"dds":0.3877551020408163,"last_synced_commit":"30585e4fae0d1c8e97ca226060d07024e2a00fb3"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CFMTech%2Fpytest-monitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CFMTech%2Fpytest-monitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CFMTech%2Fpytest-monitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CFMTech%2Fpytest-monitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CFMTech","download_url":"https://codeload.github.com/CFMTech/pytest-monitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245584750,"owners_count":20639622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpu-monitoring","integration-testing","memory-monitoring","pytest","pytest-plugin","python","qatools","quality"],"created_at":"2024-07-31T15:01:03.129Z","updated_at":"2025-03-26T03:31:19.539Z","avatar_url":"https://github.com/CFMTech.png","language":"Python","funding_links":[],"categories":["Python","Plugins"],"sub_categories":[],"readme":".. image:: docs/sources/_static/pytestmonitor_readme.png\n   :width: 160\n   :align: center\n   :alt: Pytest-Monitor\n\n------\n\n==============\npytest-monitor\n==============\n\n.. image:: https://readthedocs.org/projects/pytest-monitor/badge/?version=latest\n    :target: https://pytest-monitor.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/v/pytest-monitor.svg\n    :target: https://pypi.org/project/pytest-monitor\n    :alt: PyPI version\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-monitor.svg\n    :target: https://circleci.com/gh/jsd-spif/pymonitor.svg?style=svg\u0026circle-token=cdf89a7212139aff0cc236227cb519363981de0b\n    :alt: Python versions\n\n.. image:: https://circleci.com/gh/CFMTech/pytest-monitor/tree/master.svg?style=shield\u0026circle-token=054adaaf6a19f4f55a4f0ad419649f1807e70ea9\n    :target: https://circleci.com/gh/CFMTech/pytest-monitor/tree/master\n    :alt: See Build Status on Circle CI\n\n.. image:: https://anaconda.org/conda-forge/pytest-monitor/badges/platforms.svg\n    :target: https://anaconda.org/conda-forge/pytest-monitor\n\n.. image:: https://anaconda.org/conda-forge/pytest-monitor/badges/version.svg\n    :target: https://anaconda.org/conda-forge/pytest-monitor\n\n.. image:: https://img.shields.io/badge/License-MIT-blue.svg\n    :target: https://opensource.org/licenses/MIT\n    \n\nPytest-monitor is a pytest plugin designed for analyzing resource usage.\n\n----\n\n\nFeatures\n--------\n\n- Analyze your resources consumption through test functions:\n\n  * memory consumption\n  * time duration\n  * CPU usage\n- Keep a history of your resource consumption measurements.\n- Compare how your code behaves between different environments.\n\n\nUsage\n-----\n\nSimply run *pytest* as usual: *pytest-monitor* is active by default as soon as it is installed.\nAfter running your first session, a .pymon `sqlite` database will be accessible in the directory where pytest was run.\n\nExample of information collected for the execution context:\n\n+-----------------------------------+-----------+-------------------+---------+-------------------------------------------+---------------+--------------------+------------+-------------------------------+-------------------------------+--------------------------------------------------+\n|                              ENV_H|  CPU_COUNT|  CPU_FREQUENCY_MHZ| CPU_TYPE|                                 CPU_VENDOR|  RAM_TOTAL_MB |       MACHINE_NODE |MACHINE_TYPE| MACHINE_ARCH                  |  SYSTEM_INFO                  |                                       PYTHON_INFO|\n+===================================+===========+===================+=========+===========================================+===============+====================+============+===============================+===============================+==================================================+                   \n|  8294b1326007d9f4c8a1680f9590c23d |        36 |              3000 |  x86_64 | Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz  |      772249   | some.host.vm.fr    |     x86_64 |       64bit                   | Linux - 3.10.0-693.el7.x86_64 | 3.6.8 (default, Jun 28 2019, 11:09:04) \\n[GCC ...|\n+-----------------------------------+-----------+-------------------+---------+-------------------------------------------+---------------+--------------------+------------+-------------------------------+-------------------------------+--------------------------------------------------+\n\nHere is an example of collected data stored in the result database:\n\n+------------------------------+----------------------------------+------------------------------------------+----------------------------+----------------------------------------+----------+----------+------------+-----------+-------------+------------+-----------+\n|                      RUN_DATE|                             ENV_H|                                    SCM_ID|             ITEM_START_TIME|                                    ITEM|      KIND| COMPONENT|  TOTAL_TIME|  USER_TIME|  KERNEL_TIME|   CPU_USAGE|  MEM_USAGE|\n+==============================+==================================+==========================================+============================+========================================+==========+==========+============+===========+=============+============+===========+\n|   2020-02-17T09:11:36.731233 | 8294b1326007d9f4c8a1680f9590c23d | de23e6bdb987ae21e84e6c7c0357488ee66f2639 | 2020-02-17T09:11:36.890477 |             pkg1.test_mod1/test_sleep1 | function |     None |   1.005669 |      0.54 |       0.06  |  0.596618  | 1.781250  |\n+------------------------------+----------------------------------+------------------------------------------+----------------------------+----------------------------------------+----------+----------+------------+-----------+-------------+------------+-----------+\n|   2020-02-17T09:11:36.731233 | 8294b1326007d9f4c8a1680f9590c23d | de23e6bdb987ae21e84e6c7c0357488ee66f2639 | 2020-02-17T09:11:39.912029 |       pkg1.test_mod1/test_heavy[10-10] | function |     None |   0.029627 |      0.55 |        0.08 |  21.264498 |  1.781250 |\n+------------------------------+----------------------------------+------------------------------------------+----------------------------+----------------------------------------+----------+----------+------------+-----------+-------------+------------+-----------+\n|   2020-02-17T09:11:36.731233 | 8294b1326007d9f4c8a1680f9590c23d | de23e6bdb987ae21e84e6c7c0357488ee66f2639 | 2020-02-17T09:11:39.948922 |     pkg1.test_mod1/test_heavy[100-100] | function |     None |   0.028262 |      0.56 |        0.09 |  22.998773 |  1.781250 |\n+------------------------------+----------------------------------+------------------------------------------+----------------------------+----------------------------------------+----------+----------+------------+-----------+-------------+------------+-----------+\n|   2020-02-17T09:11:36.731233 | 8294b1326007d9f4c8a1680f9590c23d | de23e6bdb987ae21e84e6c7c0357488ee66f2639 | 2020-02-17T09:11:39.983869 |   pkg1.test_mod1/test_heavy[1000-1000] | function |     None |   0.030131 |      0.56 |        0.10 |  21.904277 |  2.132812 |\n+------------------------------+----------------------------------+------------------------------------------+----------------------------+----------------------------------------+----------+----------+------------+-----------+-------------+------------+-----------+\n|   2020-02-17T09:11:36.731233 | 8294b1326007d9f4c8a1680f9590c23d | de23e6bdb987ae21e84e6c7c0357488ee66f2639 | 2020-02-17T09:11:40.020823 | pkg1.test_mod1/test_heavy[10000-10000] | function |     None |   0.060060 |      0.57 |        0.14 |  11.821601 | 41.292969 |\n+------------------------------+----------------------------------+------------------------------------------+----------------------------+----------------------------------------+----------+----------+------------+-----------+-------------+------------+-----------+\n|   2020-02-17T09:11:36.731233 | 8294b1326007d9f4c8a1680f9590c23d | de23e6bdb987ae21e84e6c7c0357488ee66f2639 | 2020-02-17T09:11:40.093490 |        pkg1.test_mod2/test_sleep_400ms | function |     None |   0.404860 |      0.58 |        0.15 |   1.803093 |  2.320312 |\n+------------------------------+----------------------------------+------------------------------------------+----------------------------+----------------------------------------+----------+----------+------------+-----------+-------------+------------+-----------+\n|   2020-02-17T09:11:36.731233 | 8294b1326007d9f4c8a1680f9590c23d | de23e6bdb987ae21e84e6c7c0357488ee66f2639 | 2020-02-17T09:11:40.510525 |      pkg2.test_mod_a/test_master_sleep | function |     None |   5.006039 |      5.57 |        0.15 |   1.142620 |  2.320312 |\n+------------------------------+----------------------------------+------------------------------------------+----------------------------+----------------------------------------+----------+----------+------------+-----------+-------------+------------+-----------+\n|   2020-02-17T09:11:36.731233 | 8294b1326007d9f4c8a1680f9590c23d | de23e6bdb987ae21e84e6c7c0357488ee66f2639 | 2020-02-17T09:11:45.530780 |          pkg3.test_mod_cl/test_method1 | function |     None |   0.030505 |      5.58 |        0.16 | 188.164762 |  2.320312 |\n+------------------------------+----------------------------------+------------------------------------------+----------------------------+----------------------------------------+----------+----------+------------+-----------+-------------+------------+-----------+\n|   2020-02-17T09:11:36.731233 | 8294b1326007d9f4c8a1680f9590c23d | de23e6bdb987ae21e84e6c7c0357488ee66f2639 | 2020-02-17T09:11:50.582954 |     pkg4.test_mod_a/test_force_monitor | function |     test |   1.005015 |     11.57 |       0.17  | 11.681416  | 2.320312  |\n+------------------------------+----------------------------------+------------------------------------------+----------------------------+----------------------------------------+----------+----------+------------+-----------+-------------+------------+-----------+\n\nDocumentation\n-------------\n\nA full documentation is `available \u003chttps://pytest-monitor.readthedocs.io/en/latest/?badge=latest\u003e`_.\n\nInstallation\n------------\n\nYou can install *pytest-monitor* via *conda* (through the `conda-forge` channel)::\n\n    $ conda install pytest-monitor -c https://conda.anaconda.org/conda-forge\n\nAnother possibility is to install *pytest-monitor* via `pip`_ from `PyPI`_::\n\n    $ pip install pytest-monitor\n\n\nRequirements\n------------\n\nYou will need a valid Python 3.5+ interpreter. To get measures, we rely on:\n\n- *psutil* to extract CPU usage\n- *memory_profiler* to collect memory usage\n- and *pytest* (obviously!)\n\n**Note: this plugin doesn't work with unittest**\n\nStorage backends\n----------------\nBy default, pytest-monitor stores its result in a local SQLite3 local database, making results accessible.\nIf you need a more powerful way to analyze your results, checkout the\n`monitor-server-api`_ which brings both a REST Api for storing and historize your results and an API to query your data.\nAn alternative service (using MongoDB) can be used thanks to a contribution from @dremdem: `pytest-monitor-backend`_.\n\n\nContributing\n------------\n\nContributions are very welcome. Tests can be run with `tox`_. Before submitting a pull request, please ensure\nthat:\n\n* both internal tests and examples are passing.\n* internal tests have been written if necessary.\n* if your contribution provides a new feature, make sure to provide an example and update the documentation accordingly.\n\nLicense\n-------\n\nThis code is distributed under the `MIT`_ license.  *pytest-monitor* is free, open-source software.\n\n\nIssues\n------\n\nIf you encounter any problem, please `file an issue`_ along with a detailed description.\n\nAuthor\n------\n\nThe main author of `pytest-monitor` is Jean-Sébastien Dieu, who can be reached at jdieu@salsify.fr.\n\n----\n\nThis `pytest`_ plugin was generated with `Cookiecutter`_ along with `@hackebrot`_'s `cookiecutter-pytest-plugin`_ template.\n\n.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter\n.. _`@hackebrot`: https://github.com/hackebrot\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`BSD-3`: http://opensource.org/licenses/BSD-3-Clause\n.. _`GNU GPL v3.0`: http://www.gnu.org/licenses/gpl-3.0.txt\n.. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0\n.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin\n.. _`file an issue`: https://github.com/CFMTech/pytest-monitor/issues\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`tox`: https://tox.readthedocs.io/en/latest/\n.. _`pip`: https://pypi.org/project/pip/\n.. _`PyPI`: https://pypi.org/project\n.. _`monitor-server-api`: : https://github.com/CFMTech/monitor-server-api\n.. _`pytest-monitor-backend`: https://github.com/dremdem/pytest-monitor-backend\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCFMTech%2Fpytest-monitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCFMTech%2Fpytest-monitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCFMTech%2Fpytest-monitor/lists"}