Skip to main content

Python package to easily capture respource utilization and time taken for given code block or method.

Project description

smeasures - Python package for measuring resource utilization and execution time

The smeasures package provides a simple way to capture resource utilization and time taken for a given code block or method. It uses the psutil library to collect system resource usage data, and provides a decorator that can be used to wrap a function or code block to measure its execution time and resource usage.

Installation:

To install smeasures, simply run:

pip install smeasures

Usage:

To use smeasures, import the measure from the smeasures package, and surround you code to measure by Measure start and end calls like below:

from smeasures import measure

m = measure.Measure(pid, useCpuMonitor=True, cpuMonitorInterval=0.1)
m.start()

# code to measure here...

m.end()

This will print out the execution time and resource usage of the code between measure start and end calls.

Dependencies:

smeasures requires the following dependencies:

  • psutil
  • threading
  • gc

License:

smeasures is released under the MIT License.

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

smeasures-0.1.5.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

smeasures-0.1.5-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file smeasures-0.1.5.tar.gz.

File metadata

  • Download URL: smeasures-0.1.5.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for smeasures-0.1.5.tar.gz
Algorithm Hash digest
SHA256 784cfc6f2c7d9db12b1da195f68e6e259ab7e1244391ebd48cd451580c95152e
MD5 ed82660364f9de5db33b686fae3b9c0c
BLAKE2b-256 778c538c117c8e4953dac62657eaa676d7549eb2e03b5993fbd23ce418f2b7b1

See more details on using hashes here.

File details

Details for the file smeasures-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: smeasures-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for smeasures-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ff7b429e8c4f76923e4755498c746bbd4eca10685811adcbecd046bf30854ccd
MD5 562b8972ac385d7c3f06ff0daebf71bd
BLAKE2b-256 c349fc56642ce7cbf270e08964bf4a912a079e9d09d234383b04d0c1f7f750b9

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