当前位置:网站首页>Sentry developer contribution Guide - configure pycharm
Sentry developer contribution Guide - configure pycharm
2022-07-03 00:39:00 【I am for less】
summary
If you use PyCharm
Development , You need to configure some content to run and debug .
This document describes some pairs sentry
Develop useful configurations
To configure
Python
Interpreter :( Make sure it's venv
Interpreter ) for example ~/venv/sentry/bin/python
To create a configuration (run/debug
To configure ), Just go to Run | Edit Configurations...
( It can also be used in the default toolbar ).
Test runner
Sentry
Use pytest
Unit test .
establish pytest
To configure ( stay Python tests
Next )
Set a goal (Set Target
): Custom
Additional parameters (Additional Arguments
): tests/sentry
Have everything you need Dev server
Used in all settings (web
、worker
、cron
) Operation in case of ( Non debugging ):
- Create another
Python
To configure - Script path (
Script path
): <venv dir>/bin/sentry
e.g. ~/venv/sentry/bin/sentry
- Parameters (
Parameters
): devserver --workers
- Python Interpreter (
Python interpreter
): venv interpreter
- working directory (
Working dir
): (sentry In the installation directory src
route ) e.g. ~/dev/sentry/src
Note: You will not be able to debug with this configuration Web Worker
(Web Worker
By calling uwsgi
The server started ).
Use PyCharm debug
devserver
Commands exist mainly to generate daemons in separate processes , This means that in default mode debugger
Attaching to it is not very useful .
Web server
devserver
The command has a special sign , It will lead to web server
Start in the thread of the same process ( Not as web
Daemon ). This allows you to start devserver
In the same PyCharm "Debug"
Actions are attached to web server
And at the end of the life after the breakpoint .
Clone your devserver
Run the configuration and set --debug-server
Add to "Parameters"
End of field . By choice "Debug"
instead of "Run"
To start it .
--debug-server
Flags may cause the process to not respond correctly SIGINT
And the shutdown is less elegant than the original configuration . It is recommended to keep both , Match the first with Run
Command is used together , Match the second with Debug
Command is used together .
You can use --workers
Logo and --debug-server
Keep together , But please pay attention to , It is impossible to attach breakpoints to workers
, Nor can it be attached to by devserver
Any other daemons generated .
Independent daemons
To put debugger
Append to Division web
A single daemon outside , Please create a running configuration for the daemon . The following attributes should be related to your devserver
The configuration is the same .( You can clone it and only change Parameters
Field .)
- Script path (
Script path
): <venv dir>/bin/sentry
, for example : ~/venv/sentry/bin/sentry
- Python Interpreter (
Python interpreter
): venv interpreter
- working directory (
Working dir
): (sentry
In the installation directory src
route ) for example ~/dev/sentry/src
Set the parameters of the new run configuration to start the daemon run
command , for example :
-
run cron
-
run worker -c 1
Tips and troubleshooting
- If you want to debug it , The same set of modifications will apply to
getentry
Operation configuration of the project . -
PyCharm
Of Compound
The run configuration type is useful for starting multiple run configurations at once . If you are debugging one or more independent daemons that work with the development server , Then it may be convenient to set one .
- If you wish
Sentry
The behavior in the debugging environment is different from that in the normal operation , You can add any environment variable , Then in your .sentry/sentry.conf.py
Check them in the file .
for example , The screenshot below shows debugging disabled APM
Sampling settings ( Because stopping at the breakpoint will pollute the time measurement ). Please note that ,PYCHARM_DEBUG
It's an arbitrary name ; It's right PyCharm
and Sentry
There is no special significance .
- If the daemon you run alone doesn't work , You can debug
devserver --debug-server
And in src/sentry/runner/commands/devserver.py
Insert breakpoints on to troubleshoot . This will allow you to manually check devserver
Command running command .( Look near the bottom manager.add_process
call .) Try adjusting the parameters in the run configuration to match these commands , If they haven't yet .
边栏推荐
- The most painful programming problem in 2021, adventure of code 2021 Day24
- [pulsar document] concepts and architecture
- 百度智能云牵头打造智能云综合标准化平台
- 关于QByteArray存储十六进制 与十六进制互转
- helm 基础学习
- Rust所有权(非常重要)
- [Chongqing Guangdong education] audio visual language reference materials of Xinyang Normal University
- Rust ownership (very important)
- Automated defect analysis in electron microscopic images-论文阅读笔记
- mm中的GAN模型架构
猜你喜欢
[shutter] image component (load network pictures | load static pictures | load local pictures | path | provider plug-in)
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
可下载《2022年中国数字化办公市场研究报告》详解1768亿元市场
Redis21 classic interview questions, extreme pull interviewer
使用jenkins之二Job
Nacos+openfeign error reporting solution
mm中的GAN模型架构
[shutter] image component (the placeholder | transparent_image transparent image plug-in is loaded into the memory)
Why is the website slow to open?
kubernetes资源对象介绍及常用命令(五)-(NFS&PV&PVC)
随机推荐
Shell implements basic file operations (SED edit, awk match)
form表单实例化
AEM: Nanlin fan Ben et al. - plant rhizosphere growth promoting bacteria control soybean blight
Array common operation methods sorting (including ES6) and detailed use
University of Toronto:Anthony Coache | 深度强化学习的条件可诱导动态风险度量
如何系统学习机器学习
Callback event after the antv X6 node is dragged onto the canvas (stepping on a big hole record)
Redis21 classic interview questions, extreme pull interviewer
Some introduction and precautions about XML
[shutter] Introduction to the official example of shutter Gallery (learning example | email application | retail application | wealth management application | travel application | news application | a
Bloom filter
Rust ownership (very important)
Nc50528 sliding window
2022上半年值得被看见的10条文案,每一句都能带给你力量!
setInterval定时器在ie不生效原因之一:回调的是箭头函数
Basic 10 of C language: array and pointer
【雅思阅读】王希伟阅读P1(阅读判断题)
Hundreds of continuous innovation to create free low code office tools
How SQLSEVER removes data with duplicate IDS
Maya fishing house modeling