{"id":14965223,"url":"https://github.com/saltstack/pytest-system-statistics","last_synced_at":"2025-10-19T08:32:18.015Z","repository":{"id":62584207,"uuid":"442242794","full_name":"saltstack/pytest-system-statistics","owner":"saltstack","description":"Pytest Plugin Which Reports System Usage Statistics","archived":false,"fork":false,"pushed_at":"2024-07-26T10:09:28.000Z","size":94,"stargazers_count":3,"open_issues_count":4,"forks_count":5,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-01-29T11:11:53.702Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saltstack.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-27T18:34:42.000Z","updated_at":"2023-09-08T22:40:02.000Z","dependencies_parsed_at":"2024-09-13T23:38:28.440Z","dependency_job_id":"b517ee41-a56b-48d8-a367-6531b9ae7785","html_url":"https://github.com/saltstack/pytest-system-statistics","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.04761904761904767,"last_synced_commit":"84a84f00c55dc096a784695991ba1a235b0cbbd8"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack%2Fpytest-system-statistics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack%2Fpytest-system-statistics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack%2Fpytest-system-statistics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack%2Fpytest-system-statistics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saltstack","download_url":"https://codeload.github.com/saltstack/pytest-system-statistics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237092952,"owners_count":19254317,"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":[],"created_at":"2024-09-24T13:34:23.828Z","updated_at":"2025-10-19T08:32:17.117Z","avatar_url":"https://github.com/saltstack.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://img.shields.io/github/workflow/status/saltstack/pytest-system-statistics/CI?style=plastic\n   :target: https://github.com/saltstack/pytest-system-statistics/actions/workflows/testing.yml\n   :alt: CI\n\n\n.. image:: https://readthedocs.org/projects/pytest-system-statistics/badge/?style=plastic\n   :target: https://pytest-system-statistics.readthedocs.io\n   :alt: Docs\n\n\n.. image:: https://img.shields.io/codecov/c/github/saltstack/pytest-system-statistics?style=plastic\u0026token=CqV7t0yKTb\n   :target: https://codecov.io/gh/saltstack/pytest-system-statistics\n   :alt: Codecov\n\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-system-statistics?style=plastic\n   :target: https://pypi.org/project/pytest-system-statistics\n   :alt: Python Versions\n\n\n.. image:: https://img.shields.io/pypi/wheel/pytest-system-statistics?style=plastic\n   :target: https://pypi.org/project/pytest-system-statistics\n   :alt: Python Wheel\n\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=plastic\n   :target: https://github.com/psf/black\n   :alt: Code Style: black\n\n\n.. image:: https://img.shields.io/pypi/l/pytest-system-statistics?style=plastic\n   :alt: PyPI - License\n\n\n..\n   include-starts-here\n\n================================\nWhat is Pytest System Statistics\n================================\n\nIt's a `pytest`_ plugin, extracted from `pytest-salt-factories`_,  which tracks the test\nsuite CPU and memory usage and, optionally, includes a report section including that data,\nfor example:\n\n.. code-block:: text\n\n   test_proc_sys_stats.py::test_one PASSED                                                [100%]\n   ----------------------------------- Processes Statistics ------------------------------------\n     .......... System - CPU: 17.80 %  MEM: 29.70 % (Virtual Memory)  SWAP:  12.80 %\n     .. Test Suite Run - CPU:  0.00 %  MEM:  0.05 % (RSS)  MEM SUM: 0.09 % (RSS)  CHILD PROCS: 2\n     ...... FooProcess - CPU:  0.00 %  MEM:  0.02 % (RSS)  MEM SUM: 0.03 % (RSS)  CHILD PROCS: 1\n\n   ==================================== 1 passed in 0.34s ======================================\n\n\nInstall\n=======\n\nInstalling Pytest System Statistics is as simple as:\n\n.. code-block:: bash\n\n   python -m pip install pytest-system-statistics\n\n\nUsage\n=====\n\nControlling the behaviour of the plugin is made through flags which are passed to `pytest`_.\n\n.. code-block:: console\n\n   --sys-stats             Print System CPU and MEM statistics after each test execution.\n   --no-sys-stats          Do not print System CPU and MEM statistics after each test execution.\n   --sys-stats-no-children Don't include child processes memory statistics.\n   --sys-stats-uss-mem     Use the USS(\"Unique Set Size\", memory unique to a process which\n                           would be freed if the process was terminated) memory instead which\n                           is more expensive to calculate.\n\n\nTracking Additional Processes\n=============================\n\nTo include additional processes to track and report statistics against, simply add it to the\nsession scoped ``stats_processes`` fixture, for example:\n\n.. code-block:: python\n\n   @pytest.fixture\n   def my_server_process(stats_processes):\n       proc = subprocess.Popen(...)\n       stats_processes.add(\"MyServerProcess\", proc.pid)\n       try:\n           yield proc\n       finally:\n           stats_processes.remove(\"MyServerProcess\")\n\n\nContributing\n============\n\nThe pytest-system-statistics project team welcomes contributions from the community.\nFor more detailed information, refer to `CONTRIBUTING`_.\n\n.. _pytest: https://pytest.org\n.. _CONTRIBUTING: https://github.com/saltstack/pytest-system-statistics/blob/main/CONTRIBUTING.md\n.. _pytest-salt-factories: https://github.com/saltstack/pytest-salt-factories\n\n..\n   include-ends-here\n\nDocumentation\n=============\n\nThe full documentation can be seen `here \u003chttps://pytest-system-statistics.readthedocs.io\u003e`_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaltstack%2Fpytest-system-statistics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaltstack%2Fpytest-system-statistics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaltstack%2Fpytest-system-statistics/lists"}