diff options
Diffstat (limited to 'plugin/erratic/health.go')
-rw-r--r-- | plugin/erratic/health.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugin/erratic/health.go b/plugin/erratic/health.go new file mode 100644 index 000000000..1d9625e16 --- /dev/null +++ b/plugin/erratic/health.go @@ -0,0 +1,14 @@ +package erratic + +import ( + "sync/atomic" +) + +// Health implements the health.Healther interface. +func (e *Erratic) Health() bool { + q := atomic.LoadUint64(&e.q) + if e.drop > 0 && q%e.drop == 0 { + return false + } + return true +} |