Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
meta_base_code
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
宋柯
meta_base_code
Commits
2c0bdfaa
Commit
2c0bdfaa
authored
Sep 29, 2021
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改某些队列的报警时间
parent
2eac9a1d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
celery_stats_monitor.py
celery_stats/celery_stats_monitor.py
+18
-8
No files found.
celery_stats/celery_stats_monitor.py
View file @
2c0bdfaa
...
@@ -78,32 +78,36 @@ def len_list_and_send_msg(redis_clint, key_name, rules, per_sec=10):
...
@@ -78,32 +78,36 @@ def len_list_and_send_msg(redis_clint, key_name, rules, per_sec=10):
# print(key_name,res)
# print(key_name,res)
str_res
=
rules
.
parse
(
key_name
,
res
,
per_sec
=
per_sec
)
str_res
=
rules
.
parse
(
key_name
,
res
,
per_sec
=
per_sec
)
if
str_res
:
if
str_res
:
if
key_name
in
[
"graces-tapir-card"
,
"graces-es6-tapir-lbs"
,
"graces-es6-tapir-merchant"
]:
if
key_name
in
[
"graces-tapir-card"
,
"graces-es6-tapir-lbs"
,
"graces-es6-tapir-merchant"
]:
send_msg_to_dingtalk
(
str_res
,
mobiles
=
[
"19566173658"
],
secret
=
token_dict
[
key_name
][
'secret'
],
send_msg_to_dingtalk
(
str_res
,
mobiles
=
[
"19566173658"
],
secret
=
token_dict
[
key_name
][
'secret'
],
access_token
=
token_dict
[
key_name
][
'access_token'
])
access_token
=
token_dict
[
key_name
][
'access_token'
])
else
:
else
:
send_msg_to_dingtalk
(
str_res
,
mobiles
=
[
"13552564745"
,
"17813268931"
],
secret
=
token_dict
[
key_name
][
'secret'
],
send_msg_to_dingtalk
(
str_res
,
mobiles
=
[
"13552564745"
,
"17813268931"
],
secret
=
token_dict
[
key_name
][
'secret'
],
access_token
=
token_dict
[
key_name
][
'access_token'
])
access_token
=
token_dict
[
key_name
][
'access_token'
])
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
rules
=
Parse_data
()
rules
=
Parse_data
()
# 队列名和队列redis地址
# 队列名和队列redis地址
redis_clicnt_dct
=
{
thirty_
redis_clicnt_dct
=
{
"gaia-dbmw"
:
redis_old_gaia
,
"gaia-dbmw"
:
redis_old_gaia
,
"tapir-gaia-service"
:
redis_old_gaia
,
"mimas-dbmw"
:
redis_old_mimas
,
"graces-es6-tapir-diary"
:
redis_new_gaia
,
"graces-es6-tapir-diary"
:
redis_new_gaia
,
"mentha-tapir-answer"
:
redis_new_mimas
,
"mentha-tapir-tractate"
:
redis_new_mimas
,
"mimas-dbmw"
:
redis_old_mimas
,
"graces-es6-tapir-message"
:
redis_new_gaia
,
}
redis_clicnt_dct
=
{
"tapir-gaia-service"
:
redis_old_gaia
,
"graces-es6-tapir-service"
:
redis_new_gaia
,
"graces-es6-tapir-service"
:
redis_new_gaia
,
"graces-es6-tapir-service_pre"
:
redis_new_gaia
,
"graces-es6-tapir-service_pre"
:
redis_new_gaia
,
"graces-es6-tapir-doctor"
:
redis_new_gaia
,
"graces-es6-tapir-doctor"
:
redis_new_gaia
,
"mentha-tapir-answer"
:
redis_new_mimas
,
"graces-tapir-card"
:
redis_new_gaia
,
"graces-tapir-card"
:
redis_new_gaia
,
"graces-es6-tapir-lbs"
:
redis_new_gaia
,
"graces-es6-tapir-lbs"
:
redis_new_gaia
,
"graces-es6-tapir-merchant"
:
redis_new_gaia
,
"graces-es6-tapir-merchant"
:
redis_new_gaia
,
"mentha-tapir-tractate"
:
redis_new_mimas
,
}
}
per_sec
=
60
*
5
per_sec
=
60
*
5
thirty_per_sec
=
60
*
30
last_time
=
time
.
time
()
last_time
=
time
.
time
()
while
True
:
while
True
:
now
=
time
.
time
()
now
=
time
.
time
()
...
@@ -111,4 +115,10 @@ if __name__ == "__main__":
...
@@ -111,4 +115,10 @@ if __name__ == "__main__":
for
redis_clint_key
in
redis_clicnt_dct
:
for
redis_clint_key
in
redis_clicnt_dct
:
len_list_and_send_msg
(
redis_clicnt_dct
[
redis_clint_key
],
redis_clint_key
,
rules
,
per_sec
)
len_list_and_send_msg
(
redis_clicnt_dct
[
redis_clint_key
],
redis_clint_key
,
rules
,
per_sec
)
last_time
=
now
last_time
=
now
if
now
-
last_time
>=
thirty_per_sec
:
for
redis_clint_key
in
thirty_redis_clicnt_dct
:
len_list_and_send_msg
(
thirty_redis_clicnt_dct
[
redis_clint_key
],
redis_clint_key
,
rules
,
thirty_per_sec
)
last_time
=
now
time
.
sleep
(
1
)
time
.
sleep
(
1
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment