Metadata-Version: 2.4
Name: production-request
Version: 0.9.0
Summary: Metric collector for production
Author-email: BARS Group <education_dev@bars.group>
Project-URL: Homepage, https://stash.bars-open.ru/projects/M3/repos/production-request/browse
Project-URL: Repository, https://stash.bars-open.ru/scm/m3/production-request.git
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Intended Audience :: Developers
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django<5.0,>=3.1
Requires-Dist: psutil
Requires-Dist: celery<5.3,>=4.4.7
Requires-Dist: Jinja2
Requires-Dist: click
Provides-Extra: dev
Requires-Dist: isort==5.12.0; extra == "dev"
Requires-Dist: ruff==0.12.1; extra == "dev"
Requires-Dist: flake8<7,>=4.0.1; extra == "dev"
Requires-Dist: pytest<8,>=3.2.5; extra == "dev"
Requires-Dist: pytest-cov<5; extra == "dev"
Requires-Dist: nose; extra == "dev"
Requires-Dist: coverage; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx<7.5,>=7; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints<2.5,>=2; extra == "docs"
Requires-Dist: myst-parser<3.2,>=3; extra == "docs"
Requires-Dist: sphinx_design<0.7,>=0.6; extra == "docs"
Requires-Dist: sphinx_rtd_theme; extra == "docs"
Dynamic: license-file

production-request
===============================

author: BARS Group

Описание
--------

Позволяет логировать метрики запросов
(клиенсткое время, серверное время, время SQL) в production-средах


Установка
---------

Установка производится командой
-e git+https://stash.bars-open.ru/scm/budg/production_request.git@master#egg=production_request. 
При этом необходимо, чтобы при запуске *pip install* в качестве альтернативного 
index-url был указан http://pypi.bars-open.ru/simple/ 


Настройка
---------

Для подключения логирования необходимо:

1. В качестве *DATABASE_ENGINE* указать *production_request*
2. Добавить *ProductionRequestLoggingMiddleware* в перечень *MIDDLEWARE*
3. Подключить к рабочему столу *production_request_client.js* и *xhr_interceptor.js*
4. Зарегистрировать *ProductionRequestPack* в контроллере
5. Выполнить в инициализации шаблона рабочего стола функцию *startLogging*. 
Данная функция принимает на вход URL action'а *action_save_client_log* из предыдущего пункта
6. Если необходимо логировать celery-task, то в *CELERY_IMPORTS* нужно добавить *'production_request.celery_handlers'* 
    
