Monitor.py 644 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. """
  3. @author: zsc
  4. @time: 2024/11/18
  5. @desc: 监控告警
  6. """
  7. import time
  8. # 实时监控模块
  9. class RealTimeMonitor:
  10. def __init__(self, data):
  11. self.data = data
  12. def monitor(self):
  13. # 简单示例:打印实时数据流
  14. for user_actions in self.data:
  15. user = user_actions['user']
  16. process = user_actions['process']
  17. actions = user_actions['actions']
  18. product = user_actions['product']
  19. channel = user_actions['channel']
  20. print(f"User: {user}, Process: {process}, Product: {product}, Channel: {channel}, Actions: {actions}")