https://github.com/lyhue1991/bugrobot
https://github.com/lyhue1991/bugrobot
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lyhue1991/bugrobot
- Owner: lyhue1991
- Created: 2021-11-14T05:41:51.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-14T15:05:57.000Z (almost 4 years ago)
- Last Synced: 2025-05-12T14:15:17.641Z (5 months ago)
- Language: Jupyter Notebook
- Size: 271 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bugrobot 微信报警机器人
**English**
Algorithm engineers or RDs often feel anxious when monitoring their running codes.
Some codes can be running for several hours and even be running for several days.
Such as the training of Deep Learning Models and some Big Data ETL tasks.
If we can send some important messages about the running status to our email or wechat,
then we can monitor our running task from our phone.
Wow, that will be a great bless to the rest hairs of our algorithm engineers.
Actually, this can be achieved easily by send email with Python.
If we set QQ mail remind on wechat and send emails to our QQ Email, we cat receive the messages on our phone wechat.
Let's see how to do this!
**中文**
算法工程师常常会为监控代码而头痛,有些代码执行时间常常会长达数小时,甚至几天。
例如一些机器学习模型的训练,以及一些大数据ETL任务。
如果能够将执行过程中的一些中间重要信息发送到我们的微信上,随时随地在手机上看到程序是否正常运行,让一切都在掌握之中,
那么将会让算法工程师的许多头发免受骨肉分离,随风飘零之苦。
实际上我们通过利用Python代码发送邮件到我们的QQ邮箱,并在微信上设置QQ邮箱提醒,可以非常容易实现这个功能。
效果如下,让我们来看看怎么做吧!

```python
#setup bugrobot
!pip install bugrobot
``````python
```
```python
#enjoy!
``````python
import bugrobotsubject = "info@train_model.py"
msg = "auc=0.98"
receivers = ["2650115830@qq.com"]#①send message to Email!
bugrobot.send_msg(receivers,subject,msg)#②send the bug information to Email if any exception occor!
def f():
return 1/0
bugrobot.monitor_run(f,["2650115830@qq.com"])
``````python
```