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.
    • Dropdown to select all run details or only average result.
    • 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
    • Dropdown to select all run details or only average result.
    • 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.2.1.tar.gz (20.6 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.2.1-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for timeitpro-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e082f013c15ca24124acedbd8dd4a72bb3d08f7d5806650169063c563b92dea4
MD5 1319f83ef60a484637ce4e16ebc40a57
BLAKE2b-256 847d7780bf480e40f2a69ae91f3d7e6ab39c0ad38ea5cf9e7ffaebeec2f7d257

See more details on using hashes here.

File details

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

File metadata

  • Download URL: timeitpro-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.8 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 89d66be24ca22d4b93de1f89c6c39015e1648f55492a8007d4e3b8decd51fb90
MD5 ce3ab0e852481f2bffd18b0be8e0df1a
BLAKE2b-256 f7a1a799f431e9183ded66c5c73938d63a0fcbd3e5895fb775a491aab2584172

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