aboutsummaryrefslogtreecommitdiff
path: root/internal/monitor/tcp.go
diff options
context:
space:
mode:
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{