Profyle, a development tool for analysing and managing python traces
Project description
Profyle
Development tool for analysing and managing python traces
Installation
$ pip install profyle
---> 100%
Example
FastApi
Implement
- Implement the middleware:
from fastapi import FastAPI
from profyle.middleware.fastapi import ProfileMiddleware
app = FastAPI()
app.add_middleware(ProfileMiddleware)
@app.get("/items/{item_id}")
async def read_item(item_id: int):
return {"item_id": item_id}
Run
- Run the web server:
$ profyle start
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [28720]
INFO: Started server process [28722]
INFO: Waiting for application startup.
INFO: Application startup complete.
List
- List all requests tracing:
Analyses
- Profyle stands on the shoulder of giants: Viztracer and Perfetto
- Detailed function entry/exit information on timeline with source code
- Super easy to use, no source code change for most features, no package dependency
- Supports threading, multiprocessing, subprocess and async
- Logs arbitrary function/variable using RegEx without code change
- Powerful front-end, able to render GB-level trace smoothly
- Works on Linux/MacOS/Window
Flask
... coming soon
Commands
start
- Start the web server and view profile traces
$ profyle start
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [28720]
INFO: Started server process [28722]
INFO: Waiting for application startup.
INFO: Application startup complete.
clean
- Delete all profile traces
$ profyle clean
10 traces removed
check
- Check traces DB size
$ profyle check
DB size: 30MB
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
profyle-0.0.10.tar.gz
(54.4 kB
view hashes)
Built Distribution
profyle-0.0.10-py3-none-any.whl
(55.7 kB
view hashes)