Last active
January 24, 2023 21:25
-
-
Save Zmey56/802988089cf1c65676cf2a775aab1d56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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