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

Uploaded Python 3

File details

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

File metadata

  • Download URL: smeasures-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 44d5fefa74ea9193701ee2516866268253b4fb37e41c618ea2027b80ebf8e98d
MD5 dfd410189cddc395713d9587b41acd85
BLAKE2b-256 ce057a1bd63810842479068a602d9a39d83cdff7a7ddad16a50aceea1090a74d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: smeasures-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e70ff2da1d0a436ac5450fc5e45e40e8652e71568361c254e172496520d3b99b
MD5 41aa80db536f05bcc4a2d67b584e0b1c
BLAKE2b-256 231c5e3b54be3e1804aa4664511dc5b5e39367f1562568da0f72d49e35eca5b4

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