summaryrefslogtreecommitdiff
path: root/internal/failover/monitor.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/failover/monitor.go')
-rw-r--r--internal/failover/monitor.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/failover/monitor.go b/internal/failover/monitor.go
index d9028f2..5d81f22 100644
--- a/internal/failover/monitor.go
+++ b/internal/failover/monitor.go
@@ -20,6 +20,10 @@ type DroppedConMon struct {
readRxBytes func() (int64, error)
}
+// NewDroppedMonitor creates a new failover monitor
+// `pingInterval` is the interval in which to send pings
+// `pDropped` is how many pings we need to send before we deem it is dropped
+// `readRxBytes` is a function that gets the rx bytes from the client
func NewDroppedMonitor(pingInterval time.Duration, pDropped int, readRxBytes func() (int64, error)) *DroppedConMon {
return &DroppedConMon{pInterval: pingInterval, pDropped: pDropped, readRxBytes: readRxBytes}
}