Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pylint
pip install -r requirements.txt
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
5 changes: 2 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"version": "0.2.0",
"configurations": [

"configurations": [
{
"name": "main",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "main.py",
"console": "integratedTerminal",
Expand Down
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
# PythonProfiler

# PythonProfiler

Light-weight, decorator-based **time & memory profiler** that streams events to a central TCP server.
Add `@time_profile` or `@memory_profile` to any Python function and get a unified, time-ordered trace across multiple scripts, processes, or hosts without installing heavyweight agents or sharing files.
![image](https://github.com/user-attachments/assets/0e3f7a74-de75-4c52-9826-9d0c21f9de36)
# Python Profiler Viewer

A **streaming log viewer and profiler visualizer** built for large-scale Python profiling data.

---

## Features
## 🚀 Features

| | What it does | Why it matters |
|-----------------------------------|--------------|----------------|
| **Two-line integration** | `from logic.decorators import ProfilingDecorators as P` → decorate functions. | Leaves your business-logic untouched; `functools.wraps` keeps signatures & docstrings. |
| **Wall-clock latency** | Captures `datetime.now()` on entry/exit and ships a pair of timestamps. | Perfect for I/O-bound or distributed workflows where “what waited for what?” matters. :contentReference[oaicite:0]{index=0} |
| **Resident-set memory** | Reads `ru_maxrss` via the `resource` module before & after the call. | Spot leaks and unexpected growth at function granularity on Unix systems. :contentReference[oaicite:1]{index=1} |
| **Global ordering** | Every event carries a Version-1 UUID. | Collision-free merging when dozens of clients fire events in parallel. :contentReference[oaicite:2]{index=2} |
| **Zero external deps** | Uses only the Python standard library (`socket`, `uuid`, `resource`, `datetime`). | Works anywhere Python ≥ 3.8 runs. |
- 🔄 **Streaming JSONL file processing** — processes log files while loading
- 🌳 **Virtualized expandable Call Tree** — smooth scroll & expand, even for millions of calls
- 📊 **Timeline view (Plotly powered)** — visual execution timeline
- 📈 **Summary table** — aggregated total time per function
- ⚡ **Fully browser-based** — no backend server required

---

## Quick start

```bash
git clone https://github.com/Saher-Amasha/PythonProfiler.git
## 📄 Log Format

cd PythonProfiler
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt # only std-lib, but black & pytest for dev helpers
Profiler expects newline-delimited JSON arrays (`.jsonl`), where each line represents one event:

```
```json
["17:54:12.457", "start", "function_name", 123, 122, "sync"]
23 changes: 0 additions & 23 deletions app.py

This file was deleted.

15 changes: 0 additions & 15 deletions controller.py

This file was deleted.

53 changes: 0 additions & 53 deletions example_usage/example1.py

This file was deleted.

Loading