How ankan97dutta/profilis works
Project Type and Purpose
• Profilis is an open-source Python library (“tool”) for high-performance, non-blocking profiling of web applications and database operations.
• It’s framework-agnostic (Flask adapter built-in; FastAPI/Sanic planned) and provides decorators, instrumentation modules, asynchronous collection, multiple exporters, and a built-in UI dashboard.
File-Structure Analysis
• Top-level “src/profilis” folder contains:
• core (AsyncCollector, Emitter, StatsStore)
• decorators (profile_function)
• exporters (ConsoleExporter, JSONLExporter, BaseExporter)
• flask adapter (ProfilisFlask, UI blueprint)
• database instrumentation modules (sqlalchemy, pyodbc, mongo, neo4j)
• runtime (trace/span context management)
• “docs” and “examples” demonstrate usage and build processes.
• CI, docs, and packaging are driven by GitHub Workflows, mkdocs, pyproject.toml, requirements files.
README Insights
• Architecture documented under docs/architecture.
• Highlights: async batching, adapter pattern, decorator pattern, plugin-style instrumentation.