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-1.0.0.tar.gz (8.7 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-1.0.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cgroup_monitor-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c8303e46a485931fce2be713b9fb8121cba56e27b7b9e02dfdad097df0a92120
MD5 6ff98ec62c9bd52bbb9d57a1f7e74b02
BLAKE2b-256 01a44fa909d127fbf19f421b348d933bfacc1391b840be1e46b56c1325eb7b2f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cgroup_monitor-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.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-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d29157ebad78001b7840aadb7ff4cfa806ebe082f83ac27767790b08ade7727
MD5 88ff9b6877205b7733174691500e42f3
BLAKE2b-256 c200030ff63b037382b936af21466f1f9246d137b680f296b2f9a3c8a6887b4f

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