refactor: extract magic numbers to named constants
CI / test (pull_request) Successful in 1m43s
CI / lint (pull_request) Successful in 1m17s
CI / vulncheck (pull_request) Successful in 51s

Replace inline numeric literals with named constants across 14 files:
server timeouts/rate limits, cluster thresholds/intervals, DB pool
sizes, alert/dial timeouts, TUI uptime thresholds, node status
thresholds, and state history limits.
This commit was merged in pull request #153.
This commit is contained in:
2026-06-27 15:44:03 -04:00
parent edbc2beddd
commit 50f77da131
15 changed files with 108 additions and 50 deletions
+4 -4
View File
@@ -26,9 +26,9 @@ func (m Model) uptimeTimeline(days []monitor.DayReport, width int) string {
for _, d := range display {
ch := "█"
switch {
case d.UptimePct >= 99.0:
case d.UptimePct >= uptimeGoodPct:
sb.WriteString(m.st.specialStyle.Render(ch))
case d.UptimePct >= 95.0:
case d.UptimePct >= uptimeWarnPct:
sb.WriteString(m.st.warnStyle.Render(ch))
case d.UptimePct > 0:
sb.WriteString(m.st.dangerStyle.Render(ch))
@@ -39,9 +39,9 @@ func (m Model) uptimeTimeline(days []monitor.DayReport, width int) string {
pct := days[len(days)-1].UptimePct
pctStyle := m.st.specialStyle
if pct < 99.0 {
if pct < uptimeGoodPct {
pctStyle = m.st.dangerStyle
} else if pct < 99.9 {
} else if pct < uptimeExcellentPct {
pctStyle = m.st.warnStyle
}
sb.WriteString(" " + pctStyle.Render(fmt.Sprintf("%.2f%%", pct)))