Skip to content

Commit

Permalink
feat: 系统任务执行状态自监控能力支持 TencentBlueKing#7457
Browse files Browse the repository at this point in the history
  • Loading branch information
lTimej committed Jul 5, 2024
1 parent 860d33c commit 04c6cf3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gcloud/contrib/monitor/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,6 @@ def get_mq_data(request):
获取mq数据
"""
cl = pyrabbit2.Client("localhost:15672", "guest", "guest")
data = {vhost: [{"vhost": vhost, "queue_name": queue["name"], "message_count": queue["messages"], "queue_state": queue["state"], "messages": cl.get_messages(vhost, queue["name"], count=queue["messages"], requeue=True)} for queue in cl.get_queues(vhost=vhost)] for vhost in cl.get_vhost_names()}
data = {
vhost: [{"vhost": vhost, "queue_name": queue["name"], "message_count": queue["messages"], "queue_state": queue["state"], "messages": cl.get_messages(vhost, queue["name"], count=queue["messages"], requeue=True)} for queue in cl.get_queues(vhost=vhost)] for vhost in cl.get_vhost_names()}
return JsonResponse({"result": True, "data": data})

0 comments on commit 04c6cf3

Please sign in to comment.