resource-tracker


Nameresource-tracker JSON
Version 0.4.1 PyPI version JSON
download
home_pageNone
SummaryLightweight Python package for monitoring process and system resource usage with optional Metaflow integration for cloud cost optimization.
upload_time2025-08-08 18:26:56
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords resource-monitor metaflow
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # resource-tracker

A lightweight, zero-dependency Python package for monitoring resource usage
across processes and at the system level. Designed with batch jobs in mind (like
Python or R scripts, or Metaflow steps), it provides simple tools to track CPU,
memory, GPU, network, and disk utilization with minimal setup -- e.g. using a
step decorator in Metaflow to automatically track resource usage and generate a
card with data visualizations on historical resource usage and cloud server
recommendations for future runs.

## Installation

You can install the stable version of the package from PyPI:
[![resource-tracker on PyPI](https://img.shields.io/pypi/v/resource-tracker?color=%2332C955)](https://pypi.org/project/resource-tracker/)

```sh
pip install resource-tracker
```

Development version can be installed directly from the git repository:

```sh
pip install git+https://github.com/sparecores/resource-tracker.git
```

Note that depending on your operating system, you might need to also install
`psutil` (e.g. on MacOS and Windows). For more details, see the
[OS support section](#operating-system-support).

## Integrations

The `resource-tracker` Python package is designed to be used in a variety of
ways, even outside of Python. Find more details about how to use it directly
from Python, R, or via our framework integrations, such as Metaflow, in the
[integrations](https://sparecores.github.io/resource-tracker/integrations/)
section of the documentation.

## Operating System Support

The package was originally created to work on Linux systems (as the most
commonly used operating system on cloud servers) using `procfs` directly and
without requiring any further Python dependencies, but to support other
operating systems as well, now it can also use `psutil` when available.

To make sure the resource tracker works on non-Linux systems, install via:

```sh
pip install resource-tracker[psutil]
```

Minor inconsistencies between operating systems are expected, e.g. using PSS
(Proportional Set Size) instead of RSS (Resident Set Size) as the process-level
memory usage metric on Linux, as it is evenly divides the shared memory usage
between the processes using it, making it more representative of the memory
usage of the monitored applications. Mac OS X and Windows use USS (Unique Set
Size) instead.

CI/CD is set up to run tests on the below operating systems:

- Ubuntu latest LTS (24.04)
- MacOS latest (13)
- Windows latest (Windows Server 2022)

[![Unit tests status for each operating system](https://github-actions.40ants.com/spareCores/resource-tracker/matrix.svg?only=Unit%20tests)](https://github.com/SpareCores/resource-tracker/actions/workflows/tests.yaml)

## Python Version Support

The package supports Python 3.9 and above.

CI/CD is set up to run tests on the below Python versions on Ubuntu latest LTS, Windows Server 2022 and MacOS latest:

- 3.9
- 3.10
- 3.11
- 3.12
- 3.13

[![Unit tests status per Python version](https://github-actions.40ants.com/spareCores/resource-tracker/matrix.svg?only=Unit%20tests.pytest.ubuntu-latest)](https://github.com/SpareCores/resource-tracker/actions/workflows/tests.yaml)

## Performance

The performance of the `procfs` and the `psutil` implementations is similar, see
e.g.
[benchmark.py](https://github.com/SpareCores/resource-tracker/tree/main/examples/benchmark.py)
for a comparison of the two implementations when looking at process-level stats:

```
PSUtil implementation: 0.082130s avg (min: 0.067612s, max: 0.114606s)
ProcFS implementation: 0.084533s avg (min: 0.081533s, max: 0.111782s)
Speedup factor: 0.97x (psutil faster)
```

On a heavy application with many descendants (such as Google Chrome with
hundreds of processes and open tabs):

```
PSUtil implementation: 0.201849s avg (min: 0.193392s, max: 0.214061s)
ProcFS implementation: 0.182557s avg (min: 0.174610s, max: 0.192760s)
Speedup factor: 1.11x (procfs faster)
```

The system-level stats are much cheaper to collect, and there is no effective
difference in performance between the two implementations.

Why have both implementations then? The `psutil` implementation works on all
operating systems at the cost of the extra dependency, while the `procfs`
implementation works without any additional dependencies, but only on Linux.
This latter can be useful when deploying cloud applications in limited
environments without easy control over the dependencies (e.g. Metaflow step
decorator without explicit `@pypi` config).

## References

- PyPI: <https://pypi.org/project/resource-tracker>
- Documentation: <https://sparecores.github.io/resource-tracker>
- Source code: <https://github.com/SpareCores/resource-tracker>
- Project roadmap and feedback form: <https://sparecores.com/feedback/metaflow-resource-tracker>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "resource-tracker",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "resource-monitor, metaflow",
    "author": null,
    "author_email": "Gergely Daroczi <daroczig@sparecores.com>",
    "download_url": "https://files.pythonhosted.org/packages/5f/0e/b8552ba3e06d8857860996ed7fbe1cd88908ab8e594024274268fd2d2259/resource_tracker-0.4.1.tar.gz",
    "platform": null,
    "description": "# resource-tracker\n\nA lightweight, zero-dependency Python package for monitoring resource usage\nacross processes and at the system level. Designed with batch jobs in mind (like\nPython or R scripts, or Metaflow steps), it provides simple tools to track CPU,\nmemory, GPU, network, and disk utilization with minimal setup -- e.g. using a\nstep decorator in Metaflow to automatically track resource usage and generate a\ncard with data visualizations on historical resource usage and cloud server\nrecommendations for future runs.\n\n## Installation\n\nYou can install the stable version of the package from PyPI:\n[![resource-tracker on PyPI](https://img.shields.io/pypi/v/resource-tracker?color=%2332C955)](https://pypi.org/project/resource-tracker/)\n\n```sh\npip install resource-tracker\n```\n\nDevelopment version can be installed directly from the git repository:\n\n```sh\npip install git+https://github.com/sparecores/resource-tracker.git\n```\n\nNote that depending on your operating system, you might need to also install\n`psutil` (e.g. on MacOS and Windows). For more details, see the\n[OS support section](#operating-system-support).\n\n## Integrations\n\nThe `resource-tracker` Python package is designed to be used in a variety of\nways, even outside of Python. Find more details about how to use it directly\nfrom Python, R, or via our framework integrations, such as Metaflow, in the\n[integrations](https://sparecores.github.io/resource-tracker/integrations/)\nsection of the documentation.\n\n## Operating System Support\n\nThe package was originally created to work on Linux systems (as the most\ncommonly used operating system on cloud servers) using `procfs` directly and\nwithout requiring any further Python dependencies, but to support other\noperating systems as well, now it can also use `psutil` when available.\n\nTo make sure the resource tracker works on non-Linux systems, install via:\n\n```sh\npip install resource-tracker[psutil]\n```\n\nMinor inconsistencies between operating systems are expected, e.g. using PSS\n(Proportional Set Size) instead of RSS (Resident Set Size) as the process-level\nmemory usage metric on Linux, as it is evenly divides the shared memory usage\nbetween the processes using it, making it more representative of the memory\nusage of the monitored applications. Mac OS X and Windows use USS (Unique Set\nSize) instead.\n\nCI/CD is set up to run tests on the below operating systems:\n\n- Ubuntu latest LTS (24.04)\n- MacOS latest (13)\n- Windows latest (Windows Server 2022)\n\n[![Unit tests status for each operating system](https://github-actions.40ants.com/spareCores/resource-tracker/matrix.svg?only=Unit%20tests)](https://github.com/SpareCores/resource-tracker/actions/workflows/tests.yaml)\n\n## Python Version Support\n\nThe package supports Python 3.9 and above.\n\nCI/CD is set up to run tests on the below Python versions on Ubuntu latest LTS, Windows Server 2022 and MacOS latest:\n\n- 3.9\n- 3.10\n- 3.11\n- 3.12\n- 3.13\n\n[![Unit tests status per Python version](https://github-actions.40ants.com/spareCores/resource-tracker/matrix.svg?only=Unit%20tests.pytest.ubuntu-latest)](https://github.com/SpareCores/resource-tracker/actions/workflows/tests.yaml)\n\n## Performance\n\nThe performance of the `procfs` and the `psutil` implementations is similar, see\ne.g.\n[benchmark.py](https://github.com/SpareCores/resource-tracker/tree/main/examples/benchmark.py)\nfor a comparison of the two implementations when looking at process-level stats:\n\n```\nPSUtil implementation: 0.082130s avg (min: 0.067612s, max: 0.114606s)\nProcFS implementation: 0.084533s avg (min: 0.081533s, max: 0.111782s)\nSpeedup factor: 0.97x (psutil faster)\n```\n\nOn a heavy application with many descendants (such as Google Chrome with\nhundreds of processes and open tabs):\n\n```\nPSUtil implementation: 0.201849s avg (min: 0.193392s, max: 0.214061s)\nProcFS implementation: 0.182557s avg (min: 0.174610s, max: 0.192760s)\nSpeedup factor: 1.11x (procfs faster)\n```\n\nThe system-level stats are much cheaper to collect, and there is no effective\ndifference in performance between the two implementations.\n\nWhy have both implementations then? The `psutil` implementation works on all\noperating systems at the cost of the extra dependency, while the `procfs`\nimplementation works without any additional dependencies, but only on Linux.\nThis latter can be useful when deploying cloud applications in limited\nenvironments without easy control over the dependencies (e.g. Metaflow step\ndecorator without explicit `@pypi` config).\n\n## References\n\n- PyPI: <https://pypi.org/project/resource-tracker>\n- Documentation: <https://sparecores.github.io/resource-tracker>\n- Source code: <https://github.com/SpareCores/resource-tracker>\n- Project roadmap and feedback form: <https://sparecores.com/feedback/metaflow-resource-tracker>\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Lightweight Python package for monitoring process and system resource usage with optional Metaflow integration for cloud cost optimization.",
    "version": "0.4.1",
    "project_urls": {
        "changelog": "https://github.com/SpareCores/resource-tracker/blob/main/CHANGELOG.md",
        "documentation": "https://sparecores.github.io/resource-tracker/",
        "issues": "https://github.com/SpareCores/resource-tracker/issues",
        "repository": "https://github.com/SpareCores/resource-tracker"
    },
    "split_keywords": [
        "resource-monitor",
        " metaflow"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2f8cec1d949ea676fc84ab8de3d148e9d5c040fde7259f50584bb0199fd809be",
                "md5": "b6c58a6d5896cb6dcaa3b2d6e2403cd4",
                "sha256": "d28760f4a4228889bd35d615fe8e8f34d1ee4d9ab2a0bf5eff772ed31e0399f6"
            },
            "downloads": -1,
            "filename": "resource_tracker-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b6c58a6d5896cb6dcaa3b2d6e2403cd4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 234556,
            "upload_time": "2025-08-08T18:26:54",
            "upload_time_iso_8601": "2025-08-08T18:26:54.862429Z",
            "url": "https://files.pythonhosted.org/packages/2f/8c/ec1d949ea676fc84ab8de3d148e9d5c040fde7259f50584bb0199fd809be/resource_tracker-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5f0eb8552ba3e06d8857860996ed7fbe1cd88908ab8e594024274268fd2d2259",
                "md5": "0bf16818f172ecffcf02058e3cabf296",
                "sha256": "126651547df82d56f08a9af36e1e7c1a27c6bb2adcff112d29abc3570579c242"
            },
            "downloads": -1,
            "filename": "resource_tracker-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0bf16818f172ecffcf02058e3cabf296",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 212179,
            "upload_time": "2025-08-08T18:26:56",
            "upload_time_iso_8601": "2025-08-08T18:26:56.373150Z",
            "url": "https://files.pythonhosted.org/packages/5f/0e/b8552ba3e06d8857860996ed7fbe1cd88908ab8e594024274268fd2d2259/resource_tracker-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-08 18:26:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SpareCores",
    "github_project": "resource-tracker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "resource-tracker"
}
        
Elapsed time: 1.21584s