Skip to main content

Advanced Python function profiler with JSON logging and Flask dashboard

Project description

timeitPro

timeitPro is an advanced Python function profiler with JSON logging and a Flask dashboard.

Features

  • Decorator @timeit(runs=N, show_console=True) to profile functions.
  • Measures:
    • Execution time
    • CPU usage (%)
    • Memory usage (bytes)
    • Peak memory (bytes)
  • Each run generates a new JSON log with incremental filename.
  • Flask dashboard:
    • Displays results as separate line charts for each metric.
    • Dropdown to select which log file to display.
    • Table with detailed run information.
  • Console output optional (show_console=True/False).

Installation

pip install -r requirements.txt

Dependencies:

  • Flask
  • psutil

Usage

from timeitPro import timeit, run_dashboard

# Profile a function with 3 runs and console output
@timeit(runs=3, show_console=True)
def my_func():
    total = sum(range(1000000))
    return total

my_func()

# Run the dashboard
run_dashboard()

JSON Logs

  • Logs are saved as timeitPro_log_000001.json, timeitPro_log_000002.json, ...
  • Each JSON contains all runs from a profiling session.
  • Dashboard automatically lists all available log files.

Dashboard

  • Access via: http://localhost:5000/
  • Features:
    • Dropdown to select log file
    • Separate line charts for execution time, CPU, memory, peak memory
    • Table of detailed runs

License

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

timeitpro-0.1.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

timeitpro-0.1.0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file timeitpro-0.1.0.tar.gz.

File metadata

  • Download URL: timeitpro-0.1.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for timeitpro-0.1.0.tar.gz
Algorithm Hash digest
SHA256 86cfff08de338f0d9a00bf109d71cc1761c555e332775afa5a43d7ebbf3cd59c
MD5 fa2d35189315e47da058938b7b323d38
BLAKE2b-256 9c808507b1480e57b19588c32eae2788d9df50b1541eb9df172335f36e5a5e41

See more details on using hashes here.

File details

Details for the file timeitpro-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: timeitpro-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for timeitpro-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 664ef6be452a1a573019c9672cdf6ef782d1b16b9ae2aa562d6dada08ac0d532
MD5 3333293574e60580b7e8809949d6677b
BLAKE2b-256 4a5144ce65210407e63d024b7cfeba2c570fe88cb63ce9cf0aa1872180b6c709

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