Skip to main content

A simple library to monitor CPU and Memory usage only using cgroups. Mainly created to monitor the resources inside the container.

Project description

cgroup-monitor

PyPi Documentation Status License Downloads

Description

cgroup-monitor is a Python package that provides a simple interface to monitor cgroup metrics. It is designed to be used in a containerized environment to monitor the resource usage of the containers. It can be used to monitor the CPU, and memory, of the containers.

The current version is only compatible with cgroup v1 (Ubuntu 20.04 and lower)

Installation

pip install cgroup-monitor

Usage

from cgroup_monitor import CgroupMonitor

monitor = CgroupMonitor()
monitor.start_monitor()
# run task here
cpu, mem = monitor.stop_monitor()

print(f"CPU Usage: {cpu}%, Memory Usage: {mem}%")

Features

  • Monitor CPU and Memory usage of the containers
  • Simple interface to start and stop monitoring
  • Lightweight and easy to use

Documentation

The official documentation is hosted on Read the Docs: https://cgroup-monitor.readthedocs.io/en/latest/

License

This project is licensed under the terms of the MIT license, see LICENSE.

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cgroup_monitor-0.2.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cgroup_monitor-0.2.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file cgroup_monitor-0.2.0.tar.gz.

File metadata

  • Download URL: cgroup_monitor-0.2.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for cgroup_monitor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0550c5767be0ea284304520b8d8cd9f045670843f6c111f552b556df881499ab
MD5 4d6175dcc34ecc130e48bee03f56a4f1
BLAKE2b-256 8435596c6449504a52f7005216d48a510f21af781a38e846c0568738b6cd1fe7

See more details on using hashes here.

File details

Details for the file cgroup_monitor-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cgroup_monitor-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for cgroup_monitor-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a29d73fadecaa6cd8c75df04c1dba644d80e69a11ba2965c37609f62e15d9b25
MD5 3c1b1627901d237a861718d08ec1237c
BLAKE2b-256 814279bb32b15abb2f26da2ef5965b5c010a42f341e5f9594f9103db95ff1f59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page