Name | Flask-ProfilerForked JSON |
Version |
1.8.3
JSON |
| download |
home_page | https://github.com/Kalmai221/flask-profiler |
Summary | API endpoint profiler for Flask framework |
upload_time | 2024-10-28 01:02:23 |
maintainer | None |
docs_url | None |
author | Kalmai221 |
requires_python | None |
license | The MIT License (MIT) Copyright (c) 2015 Mustafa Atik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
profiler
flask
performance
optimization
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Flask-ProfilerForked
**Version: 1.8.2.3**
Flask-ProfilerForked measures the performance of your Flask application endpoints and provides detailed reports through a user-friendly web interface.
### Key Questions Addressed:
- **Where are the bottlenecks in my application?**
- **Which endpoints are the slowest?**
- **What are the most frequently called endpoints?**
- **What causes slow performance?**
- **How long did a specific request take?**
Flask-ProfilerForked allows you to monitor all your endpoints' performance and inspect incoming requests by drilling down through filters.
---
## Screenshots
### Dashboard View
The dashboard provides a summary of the application’s performance:
![Dashboard View](https://github.com/Kalmai221/flask-profiler/blob/master/resources/Dashboard.png?raw=true)
### Filtering Requests
You can apply filters to investigate specific requests:
![Filtering](https://github.com/Kalmai221/flask-profiler/blob/master/resources/Filtering.png?raw=true)
---
## Quick Start
### Installation
To install Flask-ProfilerForked, use:
```sh
pip install Flask-ProfilerForked
```
For the latest development version, use:
```sh
pip install git+https://github.com/Kalmai221/flask-profiler@master
```
### Example Setup
Here’s an example Flask application using Flask-ProfilerForked:
```python
# app.py
from flask import Flask
import flask_profiler
app = Flask(__name__)
app.config["DEBUG"] = True
# Flask-Profiler configuration
app.config["flask_profiler"] = {
"enabled": app.config["DEBUG"],
"storage": {
"engine": "sqlite"
},
"basicAuth": {
"enabled": True,
"users": {
"1": {
"username": "admin",
"password": "password"
},
"2": {
"username": "user",
"password": "password"
}
}
},
"ignore": [
"^/static/.*"
],
"updateCheck": False
}
@app.route('/product/<id>', methods=['GET'])
def get_product(id):
return f"Product ID is {id}"
# Activate flask-profiler
flask_profiler.init_app(app)
# Profile specific endpoint
@app.route('/doSomethingImportant', methods=['GET'])
@flask_profiler.profile()
def do_something_important():
return "This endpoint is being profiled."
if __name__ == '__main__':
app.run(host="127.0.0.1", port=5000)
```
---
## Using with Different Databases
Flask-ProfilerForked supports **SQLite**, **MongoDB**, **PostgreSQL**, **MySQL**, and more. Here's how to set up some of the common database engines:
### SQLite Configuration:
```python
app.config["flask_profiler"] = {
"storage": {
"engine": "sqlite",
}
}
```
| Key | Description | Default Value |
|---------------|------------------------------------|---------------------------|
| `storage.FILE` | SQLite database file name | `flask_profiler.sql` |
| `storage.TABLE` | Table name to store profiling data | `measurements` |
### MongoDB Configuration:
```python
app.config["flask_profiler"] = {
"storage": {
"engine": "mongodb",
}
}
```
| Key | Description | Default Value |
|---------------------|-------------------------------------|---------------|
| `storage.MONGO_URL` | MongoDB connection string | `mongodb://localhost` |
| `storage.DATABASE` | Database name | `flask_profiler` |
| `storage.COLLECTION` | Collection name | `measurements` |
---
## Custom Database Engine
You can specify a custom storage engine as follows:
```python
app.config["flask_profiler"] = {
"storage": {
"engine": "custom.project.flask_profiler.mysql.MysqlStorage",
"MYSQL": "mysql://user:password@localhost/flask_profiler"
}
}
```
---
## Sampling Control
You can control the number of samples taken with a custom `sampling_function`. Here are two examples:
**Random Sampling (1 in 100 requests):**
```python
import random
app.config["flask_profiler"] = {
"sampling_function": lambda: True if random.randint(1, 100) == 42 else False
}
```
**Sample Specific Users:**
```python
app.config["flask_profiler"] = {
"sampling_function": lambda: True if user == 'admin' else False
}
```
---
## Changing Flask-Profiler Endpoint Root
By default, Flask-Profiler is available at `/profiler`. To change this:
```python
app.config["flask_profiler"] = {
"endpointRoot": "custom-profiler-root"
}
```
---
## Ignoring Endpoints
To ignore specific endpoints from being tracked, use regex patterns:
```python
app.config["flask_profiler"] = {
"ignore": [
"^/static/.*",
"/api/users/\w+/password"
]
}
```
---
## Contributing (Wiki coming soon)
Contributions are welcome! Review the [Contributing Guidelines](https://github.com/Kalmai221/flask-profiler/wiki/Development) for more details on:
- Submitting issues
- Contributing solutions
- Adding new features
## License
MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/Kalmai221/flask-profiler",
"name": "Flask-ProfilerForked",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "profiler, flask, performance, optimization",
"author": "Kalmai221",
"author_email": "Kalmai221PlaysOfficial@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/28/fe/ca025024ab2183c9d24956af9ce4bafbccf52efe12131164423e3c688e11/flask_profilerforked-1.8.3.tar.gz",
"platform": "any",
"description": "# Flask-ProfilerForked\n\n**Version: 1.8.2.3**\n\nFlask-ProfilerForked measures the performance of your Flask application endpoints and provides detailed reports through a user-friendly web interface.\n\n### Key Questions Addressed:\n- **Where are the bottlenecks in my application?**\n- **Which endpoints are the slowest?**\n- **What are the most frequently called endpoints?**\n- **What causes slow performance?**\n- **How long did a specific request take?**\n\nFlask-ProfilerForked allows you to monitor all your endpoints' performance and inspect incoming requests by drilling down through filters.\n\n---\n\n## Screenshots\n\n### Dashboard View\nThe dashboard provides a summary of the application\u2019s performance:\n![Dashboard View](https://github.com/Kalmai221/flask-profiler/blob/master/resources/Dashboard.png?raw=true)\n\n### Filtering Requests\nYou can apply filters to investigate specific requests:\n![Filtering](https://github.com/Kalmai221/flask-profiler/blob/master/resources/Filtering.png?raw=true)\n\n---\n\n## Quick Start\n\n### Installation\n\nTo install Flask-ProfilerForked, use:\n\n```sh\npip install Flask-ProfilerForked\n```\n\nFor the latest development version, use:\n\n```sh\npip install git+https://github.com/Kalmai221/flask-profiler@master\n```\n\n### Example Setup\n\nHere\u2019s an example Flask application using Flask-ProfilerForked:\n\n```python\n# app.py\nfrom flask import Flask\nimport flask_profiler\n\napp = Flask(__name__)\napp.config[\"DEBUG\"] = True\n\n# Flask-Profiler configuration\napp.config[\"flask_profiler\"] = {\n \"enabled\": app.config[\"DEBUG\"],\n \"storage\": {\n \"engine\": \"sqlite\"\n },\n \"basicAuth\": {\n \"enabled\": True,\n \"users\": {\n \"1\": {\n \"username\": \"admin\",\n \"password\": \"password\"\n },\n \"2\": {\n \"username\": \"user\",\n \"password\": \"password\"\n }\n }\n },\n \"ignore\": [\n \"^/static/.*\"\n ],\n \"updateCheck\": False\n}\n\n@app.route('/product/<id>', methods=['GET'])\ndef get_product(id):\n return f\"Product ID is {id}\"\n\n# Activate flask-profiler\nflask_profiler.init_app(app)\n\n# Profile specific endpoint\n@app.route('/doSomethingImportant', methods=['GET'])\n@flask_profiler.profile()\ndef do_something_important():\n return \"This endpoint is being profiled.\"\n\nif __name__ == '__main__':\n app.run(host=\"127.0.0.1\", port=5000)\n```\n\n---\n\n## Using with Different Databases\n\nFlask-ProfilerForked supports **SQLite**, **MongoDB**, **PostgreSQL**, **MySQL**, and more. Here's how to set up some of the common database engines:\n\n### SQLite Configuration:\n```python\napp.config[\"flask_profiler\"] = {\n \"storage\": {\n \"engine\": \"sqlite\",\n }\n}\n```\n\n| Key | Description | Default Value |\n|---------------|------------------------------------|---------------------------|\n| `storage.FILE` | SQLite database file name | `flask_profiler.sql` |\n| `storage.TABLE` | Table name to store profiling data | `measurements` |\n\n### MongoDB Configuration:\n```python\napp.config[\"flask_profiler\"] = {\n \"storage\": {\n \"engine\": \"mongodb\",\n }\n}\n```\n\n| Key | Description | Default Value |\n|---------------------|-------------------------------------|---------------|\n| `storage.MONGO_URL` | MongoDB connection string | `mongodb://localhost` |\n| `storage.DATABASE` | Database name | `flask_profiler` |\n| `storage.COLLECTION` | Collection name | `measurements` |\n\n---\n\n## Custom Database Engine\n\nYou can specify a custom storage engine as follows:\n\n```python\napp.config[\"flask_profiler\"] = {\n \"storage\": {\n \"engine\": \"custom.project.flask_profiler.mysql.MysqlStorage\",\n \"MYSQL\": \"mysql://user:password@localhost/flask_profiler\"\n }\n}\n```\n\n---\n\n## Sampling Control\n\nYou can control the number of samples taken with a custom `sampling_function`. Here are two examples:\n\n**Random Sampling (1 in 100 requests):**\n```python\nimport random\napp.config[\"flask_profiler\"] = {\n \"sampling_function\": lambda: True if random.randint(1, 100) == 42 else False\n}\n```\n\n**Sample Specific Users:**\n```python\napp.config[\"flask_profiler\"] = {\n \"sampling_function\": lambda: True if user == 'admin' else False\n}\n```\n\n---\n\n## Changing Flask-Profiler Endpoint Root\n\nBy default, Flask-Profiler is available at `/profiler`. To change this:\n\n```python\napp.config[\"flask_profiler\"] = {\n \"endpointRoot\": \"custom-profiler-root\"\n}\n```\n\n---\n\n## Ignoring Endpoints\n\nTo ignore specific endpoints from being tracked, use regex patterns:\n\n```python\napp.config[\"flask_profiler\"] = {\n \"ignore\": [\n \"^/static/.*\",\n \"/api/users/\\w+/password\"\n ]\n}\n```\n\n---\n\n## Contributing (Wiki coming soon)\n\nContributions are welcome! Review the [Contributing Guidelines](https://github.com/Kalmai221/flask-profiler/wiki/Development) for more details on:\n\n- Submitting issues\n- Contributing solutions\n- Adding new features\n\n## License\nMIT\n",
"bugtrack_url": null,
"license": "The MIT License (MIT) Copyright (c) 2015 Mustafa Atik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "API endpoint profiler for Flask framework",
"version": "1.8.3",
"project_urls": {
"Homepage": "https://github.com/Kalmai221/flask-profiler"
},
"split_keywords": [
"profiler",
" flask",
" performance",
" optimization"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5a55e6462571a1517adc8ec28cbdae4aec49f6f886d44f05ed61861ae88360da",
"md5": "c2ea30d1326424d8e0a6f001a7e6681a",
"sha256": "021a6518b1083069987b6ab162c68522e18b0ff827e6bf76ef42c245a7e4a55f"
},
"downloads": -1,
"filename": "Flask_ProfilerForked-1.8.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c2ea30d1326424d8e0a6f001a7e6681a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 126160,
"upload_time": "2024-10-28T01:02:22",
"upload_time_iso_8601": "2024-10-28T01:02:22.213089Z",
"url": "https://files.pythonhosted.org/packages/5a/55/e6462571a1517adc8ec28cbdae4aec49f6f886d44f05ed61861ae88360da/Flask_ProfilerForked-1.8.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "28feca025024ab2183c9d24956af9ce4bafbccf52efe12131164423e3c688e11",
"md5": "db4ee926603eb631c8800e5df1d7cff4",
"sha256": "92f64bde95855d6d6376981dc53daf9b24609e528a660a5e1c6fad34299bb7df"
},
"downloads": -1,
"filename": "flask_profilerforked-1.8.3.tar.gz",
"has_sig": false,
"md5_digest": "db4ee926603eb631c8800e5df1d7cff4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 126460,
"upload_time": "2024-10-28T01:02:23",
"upload_time_iso_8601": "2024-10-28T01:02:23.750438Z",
"url": "https://files.pythonhosted.org/packages/28/fe/ca025024ab2183c9d24956af9ce4bafbccf52efe12131164423e3c688e11/flask_profilerforked-1.8.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-28 01:02:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Kalmai221",
"github_project": "flask-profiler",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "flask-profilerforked"
}