aboutsummaryrefslogtreecommitdiff
path: root/plugin/erratic
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/erratic')
-rw-r--r--plugin/erratic/README.md4
-rw-r--r--plugin/erratic/health.go14
2 files changed, 18 insertions, 0 deletions
diff --git a/plugin/erratic/README.md b/plugin/erratic/README.md
index f606eef42..3f3f75d3d 100644
--- a/plugin/erratic/README.md
+++ b/plugin/erratic/README.md
@@ -25,6 +25,10 @@ erratic {
* `delay`: delay 1 per **AMOUNT** of queries for **DURATION**, the default for **AMOUNT** is 2 and
the default for **DURATION** is 100ms.
+## Health
+
+This plugin implements dynamic health checking. For every dropped query it turns unhealthy.
+
## Examples
~~~ corefile
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
+}
arred/pg Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/snapshots/export.hmr.debug.js (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2022-04-21Add `bun run ${script-name}` clarification (#151)Gravatar Lawrence Chen 1-0/+4
2022-04-20[misc] Fix broken build on macOSGravatar Jarred Sumner 2-5/+11
2022-04-18[misc] explain why wasm isn't released yetGravatar Jarred Sumner 1-1/+4