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.3.tar.gz (24.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.2.3-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: timeitpro-0.2.3.tar.gz
  • Upload date:
  • Size: 24.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.2.3.tar.gz
Algorithm Hash digest
SHA256 0f76642f4cf6a1d9d67c7254b8681ec1d0a51fed2a5a0dba86d4464c0146c5f9
MD5 7bd66615e9991548ed50b5ce91195570
BLAKE2b-256 658c6bed1cfca8e4253551b2b8074a308bf322b54cba5cfb9f9546b43e581d58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: timeitpro-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 25.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d94f65af98ddaa8a21800b540172306a7b6b4e77778554b62218a7852523ac6c
MD5 56d137990be27cf34f0ce84128ff842e
BLAKE2b-256 24d09fa31238735c5c1456cfcdfc929bdef80593aca1044813d02979e0386ff0

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