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(100_000))
    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

Dashboard Preview

Here is an example of the timeitPro dashboard report:

Dashboard Report

License

GNU General Public License v3 (GPLv3)

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.1.tar.gz (18.0 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.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: timeitpro-0.1.1.tar.gz
  • Upload date:
  • Size: 18.0 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.1.tar.gz
Algorithm Hash digest
SHA256 81b44c9778bba1c91281cb8e49e4daa9ffc0cbb6af078b1a363c0428efcb8d7e
MD5 3f909f60afd8493ea660bf143440f0ad
BLAKE2b-256 377c8c245c06527591b1ce34181039f8f9cf45cfade97ccab7f849cdc8cb449b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: timeitpro-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5cd8bed2a5d914aa8d79eae4f56adbae7dee0927fabc5088ee955bc6829a3528
MD5 8e9d3991e74316283085cdee950d3ad8
BLAKE2b-256 e4a0fcdfccb42556969d913fbaa889fbf8c22d6b224f55bf95828b16373c32da

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