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.4.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.4-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smeasures-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 948e008613ea74e5e279a7d7d67033d1cd534259afb883f3afe69fae12a000b6
MD5 5a80cb131e9ca8b809f08cfc91bfa996
BLAKE2b-256 fca9f29856b7026c200985cfdae859032c6727329b94fa0d0790ee28e100a914

See more details on using hashes here.

File details

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

File metadata

  • Download URL: smeasures-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f8520fd7f49a0b5e2a081ee8151b3beca48a7f156a6f254ad0c9886b7f628c1d
MD5 bef27d33116b3fd0a2afa8287cc830a5
BLAKE2b-256 a4dfced533f75e98d865f3f2621618a27767d3df21cb92ace32fb2164ab111bd

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