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.2.tar.gz (2.7 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.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smeasures-0.1.2.tar.gz
  • Upload date:
  • Size: 2.7 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.2.tar.gz
Algorithm Hash digest
SHA256 424898aafba694118e50bc9dc5c40bd63bee31b4d8e286bc6e67f41df9ec2efb
MD5 8a53eb5d35a539657b8e0568c482286a
BLAKE2b-256 8320050eeff2d35e19e561f3cfecac470cb35bb4f78f236bb0c5a873f3840d37

See more details on using hashes here.

File details

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

File metadata

  • Download URL: smeasures-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9792dd5e8a0b566bcc6e85ceaf31bc3e942ce916fcaa9efa2a4d00f4c0dc39fd
MD5 5e245908c2e561784d503f0a3afd4e8f
BLAKE2b-256 fa3404a24c0d53a124104399244ec3e0f727ab76461ad410fc501e826e03e6c2

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