https://github.com/joshcap20/codeauditweb
A FastAPI-based web tool for comprehensive performance analysis and endpoint testing of code, featuring execution time tracking, memory usage, and detailed profiling.
https://github.com/joshcap20/codeauditweb
code-optimization code-profiling developer-tools endpoint-testing execution-time fastapi memory-usage performance-analysis python
Last synced: about 2 months ago
JSON representation
A FastAPI-based web tool for comprehensive performance analysis and endpoint testing of code, featuring execution time tracking, memory usage, and detailed profiling.
- Host: GitHub
- URL: https://github.com/joshcap20/codeauditweb
- Owner: JoshCap20
- License: mit
- Created: 2023-12-28T05:11:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-29T12:27:04.000Z (over 1 year ago)
- Last Synced: 2025-02-02T08:42:18.852Z (4 months ago)
- Topics: code-optimization, code-profiling, developer-tools, endpoint-testing, execution-time, fastapi, memory-usage, performance-analysis, python
- Language: Python
- Homepage:
- Size: 3.71 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# CodeAuditWeb
CodeAuditWeb is a web application designed for developers and coders to test and analyze the performance of their code. Built on FastAPI, it provides an intuitive interface to execute code snippets, analyze execution time, memory usage, and detailed profiling, with additional graphical analysis available. Additionally, it features an endpoint testing tool allowing users to test various HTTP methods.
Currently, this project supports Python, with plans to add support for other languages in the future. Feel free to contribute to the project by adding new analysis strategies or additional language support.
## Features
### Code Testing and Analysis
- **Execution Time Measurement**: Analyze the execution time of code snippets, useful for optimizing code performance.
- **Memory Usage Analysis**: Measure the memory footprint of code execution, crucial for resource-intensive applications.
- **Detailed Profiling**:
- **Basic Profiling**: General code profiling to identify bottlenecks.
- **Advanced Profiling**: Line-by-line profiling for more in-depth analysis.
- **Graph Generation**:
- **DotGraph**: Generate graphical representations of code execution flow.
- **FlameGraph**: Create flame graphs for performance visualization.### Endpoint Testing
- Supports various HTTP methods: GET, PUT, DELETE, PATCH, POST.
- Customizable requests with URL, header, and body inputs.## Demo
#### Code Testing

#### Endpoint Testing

## Getting Started
### Prerequisites
Before running CodeAuditWeb, ensure you have the following installed:
- Python 3.x
- pip (Python package manager)
- Graphviz (for graph generation)
- Other Python dependencies listed in `requirements.txt`### Installation
1. Clone the repository:
```bash
git clone https://github.com/JoshCap20/CodeAuditWeb.git
cd CodeAuditWeb
```
2. Install Python dependencies (recommended in a virtual environment):```bash
pip install -r requirements.txt
```
3. Run the setup script to check and install additional requirements:```bash
python setup.py
```
4. Run the FastAPI server:```bash
uvicorn main:app --reload
```
OR
```bash
python main.py
```
(uses default host and port settings from `config.py`)### Usage
#### Code Testing
1. Access the web interface at `http://localhost:8000/`.
2. Enter the code snippet in the provided code editor.
3. Choose the desired performance analysis strategies (time, memory, profiling).
4. Click 'Run Code' to execute and analyze the code.#### Endpoint Testing
1. Switch to the Endpoint tab at `http://localhost:8000/endpoint`.
2. Enter the URL, select the HTTP method, and provide headers and body if necessary.
3. Click 'Send Request' to test the endpoint.## Modularity and Customization
The application is modular, allowing easy addition of new analysis strategies and additional language support in the `measures` directory. These are used to populate the options in the web interface.
Configuration settings in config.py can be modified as per requirements.