aboutsummaryrefslogtreecommitdiff
path: root/internal/monitor/tcp.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-01-19 16:59:59 -0800
committerFuwn <[email protected]>2026-01-19 16:59:59 -0800
commit697fc99d8e340ea44c73c5bb046cad09d759c4c3 (patch)
tree401c75aa8539fee5f94684f50a7f723f1a62079e /internal/monitor/tcp.go
parentfeat: Add group defaults, content checking, SSL tracking for Gemini, hide/rou... (diff)
downloadkaze-697fc99d8e340ea44c73c5bb046cad09d759c4c3.tar.xz
kaze-697fc99d8e340ea44c73c5bb046cad09d759c4c3.zip
feat: Add round_uptime option to round uptime percentages
Diffstat (limited to 'internal/monitor/tcp.go')
-rw-r--r--internal/monitor/tcp.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/monitor/tcp.go b/internal/monitor/tcp.go
index d14a5f1..da0a822 100644
--- a/internal/monitor/tcp.go
+++ b/internal/monitor/tcp.go
@@ -17,6 +17,7 @@ type TCPMonitor struct {
timeout time.Duration
retries int
roundResponseTime bool
+ roundUptime bool
}
// NewTCPMonitor creates a new TCP monitor
@@ -34,6 +35,7 @@ func NewTCPMonitor(cfg config.MonitorConfig) (*TCPMonitor, error) {
timeout: cfg.Timeout.Duration,
retries: cfg.Retries,
roundResponseTime: cfg.RoundResponseTime,
+ roundUptime: cfg.RoundUptime,
}, nil
}
@@ -72,6 +74,11 @@ func (m *TCPMonitor) RoundResponseTime() bool {
return m.roundResponseTime
}
+// RoundUptime returns whether to round uptime percentage
+func (m *TCPMonitor) RoundUptime() bool {
+ return m.roundUptime
+}
+
// Check performs the TCP connection check
func (m *TCPMonitor) Check(ctx context.Context) *Result {
result := &Result{