|
ADS-IDAC Engine 5.0.0
|
Send completion notifications via ntfy.sh or Discord webhooks using curl. More...
#include "Notification.h"#include <cstdlib>#include <sstream>#include <iostream>#include <iomanip>#include <functional>#include <unistd.h>Go to the source code of this file.
Functions | |
| static std::string | format_time (double seconds) |
| Format wall time as human-readable string. More... | |
| static std::string | project_name (const std::string &path) |
| Extract the last path component as the project name. More... | |
| static void | send_ntfy (const std::string &topic, const RunSummary &summary) |
| static void | send_discord (const std::string &webhook_url, const RunSummary &summary) |
| std::string | auto_ntfy_topic () |
| Generate a default ntfy topic name: "ads" + 4 hex chars from hostname hash. Example: "ads7f3a". More... | |
| void | send_completion_notification (const RunSummary &summary) |
| Send completion notifications to all configured targets. Non-fatal: prints a warning if curl fails, never throws. More... | |
Variables | |
| std::string | notify_ntfy_topic |
| Global notification targets (set by Scheduler::parseOptions). More... | |
| std::string | notify_discord_webhook |
Send completion notifications via ntfy.sh or Discord webhooks using curl.
Definition in file Notification.cpp.
| std::string auto_ntfy_topic | ( | ) |
Generate a default ntfy topic name: "ads" + 4 hex chars from hostname hash. Example: "ads7f3a".
Definition at line 101 of file Notification.cpp.
Referenced by Scheduler::parseOptions().
|
static |
Format wall time as human-readable string.
Definition at line 17 of file Notification.cpp.
Referenced by send_discord(), and send_ntfy().
|
static |
Extract the last path component as the project name.
Definition at line 34 of file Notification.cpp.
Referenced by send_discord(), and send_ntfy().
| void send_completion_notification | ( | const RunSummary & | summary | ) |
Send completion notifications to all configured targets. Non-fatal: prints a warning if curl fails, never throws.
Definition at line 111 of file Notification.cpp.
References notify_discord_webhook, notify_ntfy_topic, send_discord(), and send_ntfy().
Referenced by main().
|
static |
Definition at line 68 of file Notification.cpp.
References format_time(), RunSummary::project, project_name(), RunSummary::ranks, RunSummary::sequences, RunSummary::solver, RunSummary::truncation_time, and RunSummary::wall_seconds.
Referenced by send_completion_notification().
|
static |
Definition at line 41 of file Notification.cpp.
References format_time(), RunSummary::project, project_name(), RunSummary::ranks, RunSummary::sequences, and RunSummary::wall_seconds.
Referenced by send_completion_notification().
| std::string notify_discord_webhook |
Definition at line 14 of file Notification.cpp.
Referenced by Scheduler::parseOptions(), and send_completion_notification().
| std::string notify_ntfy_topic |
Global notification targets (set by Scheduler::parseOptions).
Definition at line 13 of file Notification.cpp.
Referenced by Scheduler::parseOptions(), and send_completion_notification().