macula_app_monitor (macula v0.20.5)
View SourceMacula App Monitor
Runtime defense monitor for deployed applications: - Memory usage monitoring - Message queue monitoring - Crash rate detection - Throttle/Kill/Quarantine actions
Summary
Functions
Get stats for all monitored applications
Get monitoring stats for an application
Check if an application is quarantined
Kill an application
Quarantine an application (stop and prevent restart)
Restore a quarantined application
Set crash threshold for an application
Set memory limit for an application
Set message queue limit for an application
Start the app monitor
Start monitoring an application
Stop monitoring an application
Throttle an application (reduce priority)
Functions
Get stats for all monitored applications
-spec get_stats(PackageName :: binary()) -> {ok, #{memory_mb := non_neg_integer(), message_queue := non_neg_integer(), crash_count := non_neg_integer(), status := atom()}} | {error, not_found}.
Get monitoring stats for an application
Check if an application is quarantined
Kill an application
Quarantine an application (stop and prevent restart)
Restore a quarantined application
-spec set_crash_threshold(PackageName :: binary(), MaxCrashes :: pos_integer(), WindowSec :: pos_integer()) -> ok | {error, not_found}.
Set crash threshold for an application
-spec set_memory_limit(PackageName :: binary(), LimitMB :: pos_integer()) -> ok | {error, not_found}.
Set memory limit for an application
-spec set_message_queue_limit(PackageName :: binary(), Limit :: pos_integer()) -> ok | {error, not_found}.
Set message queue limit for an application
Start the app monitor
Start monitoring an application
-spec stop_monitoring(PackageName :: binary()) -> ok.
Stop monitoring an application
Throttle an application (reduce priority)