Skip to content

Instantly share code, notes, and snippets.

@Zmey56
Last active January 24, 2023 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zmey56/802988089cf1c65676cf2a775aab1d56 to your computer and use it in GitHub Desktop.
Save Zmey56/802988089cf1c65676cf2a775aab1d56 to your computer and use it in GitHub Desktop.
def global_monitoring(chat=None):
chat_id = chat or 0000000000
alerts = [
{"mertics": ["users_feed", "likes", "views", "ctr"], "slice": "total"},
{"mertics": ["users_feed", "likes", "views", "ctr"], "slice": "os"},
{"mertics": ["users_msg", "messages", "mpu"], "slice": "total"},
]
time = Getch('''SELECT toStartOfFifteenMinutes(max(time)) - interval 15 minute AS mas_time
FROM simulator.feed_actions WHERE toDate(time) >= today() - 1''').df
time = time['mas_time'].iloc[0]
for alert_data in alerts:
get_alert(alert_data, time, chat=chat_id)
global_monitoring(chat=None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment