Skip to main content

Python tool to track the memory and time requirements of software.

Project description

Pypi project Pypi total project downloads

Python tool to track the memory and time requirements of software.

Requirements

Please do note that this package makes use of proc/meminfo, so it is strictly compatible only with Linux systems.

As most tracker systems, this one works best if there is a limited amount of noise in the system. Do not run other software while running the benchmark, or your results may be skewed.

Installing package

As usual, to install this package from Pypi just run:

pip install memory_time_tracker

Usage example

You can use this package to track the execution of a given method as follows:

from memory_time_tracker import Tracker
from time import sleep
from tqdm.auto import trange
import numpy as np
import pandas as pd

def example_function():
    arrays = []
    for i in trange(10, desc="Running test"):
        sleep(0.1)
        arrays.append(np.zeros((10000, 1000)))

path = "/tmp/tracker.log"

with Tracker(path):
    example_function()

# The last line of the footer is used to mark whether
# the execution was successfull or a crash happened
# and the logger died.
df = pd.read_csv(
    path,
    skipfooter=1,
    engine="python"
)

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

memory_time_tracker-0.0.1.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file memory_time_tracker-0.0.1.tar.gz.

File metadata

  • Download URL: memory_time_tracker-0.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9

File hashes

Hashes for memory_time_tracker-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c7a4892e4b53949dcba08115b69d7653d1e5cebe4ba9d0f2b614a0c780d07ed3
MD5 709432d8107a27e783cffef74bd0feae
BLAKE2b-256 7e2567fe9241fbb9bdbc28b14a0e44866979c887c7f4fed287b4e780d62ccf3c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page