class

Ping::Settings

Inherits Reference < Object

Shared mutable settings for severity thresholds and chart colors. severity levels: 0=ok, 1=warn, 2=alert, 3=critical

Constants

APP_NAME = "ping-ui"
DEFAULT_INTERVAL_MS = 1000
HISTORY_DB_FILENAME = "history.sqlite3"
HISTORY_DB_OVERRIDE_ENV = "PING_UI_DB_PATH"
MAX_INTERVAL_MS = 5000
MAX_RECENT_HOSTS = 10
MIN_INTERVAL_MS = 100
SETTINGS_FILENAME = "settings.json"

Constructors

load
Source

Class methods

config_dir
Source
history_db_path
Source
history_dir
Source
settings_path
Source

Instance methods

add_recent_host(host : String) : Nil
Source
alert_threshold
Source
alert_threshold=(alert_threshold : Int32)
Source
clamp_interval_ms(value : Int32) : Int32
Source
color_alert
Source
color_alert=(color_alert : Tuple(Float64, Float64, Float64))
Source
color_critical
Source
color_critical=(color_critical : Tuple(Float64, Float64, Float64))
Source
color_for(severity : Int32) : Tuple(Float64, Float64, Float64)
Source
color_ok

Colors as {r, g, b} in 0.0..1.0

Source
color_ok=(color_ok : Tuple(Float64, Float64, Float64))

Colors as {r, g, b} in 0.0..1.0

Source
color_warn
Source
color_warn=(color_warn : Tuple(Float64, Float64, Float64))
Source
normalize!
Source
notify_enabled=(notify_enabled : Bool)
Source
notify_enabled?
Source
notify_failures_threshold
Source
notify_failures_threshold=(notify_failures_threshold : Int32)
Source
recent_hosts
Source
recent_hosts=(recent_hosts : Array(String))
Source
save
Source
warn_threshold

Failure-streak thresholds: streak <= threshold => that level

Source
warn_threshold=(warn_threshold : Int32)

Failure-streak thresholds: streak <= threshold => that level

Source