Fault injection over a stack run (hc-12): create the proxies of a faults plan in the run's toxiproxy, then add, remove, reset and list toxics on them through IToxiproxyClient.
The run's toxiproxy is recorded by install! in the ctx's :faults
atom, {run {:url :proxies [name]}}: in memory only, the stack ops
install again when they re-adopt a run. The hc-6 stack ops call it after
bringing toxiproxy up (promote.faults/project-spec) and connecting it
(promote.faults/joins), with the host URL of its published API port.
:toxiproxy in the ctx, (fn [url] IToxiproxyClient), builds the client;
it defaults to the HTTP adapter.
Fault injection over a stack run (hc-12): create the proxies of a faults
plan in the run's toxiproxy, then add, remove, reset and list toxics on
them through IToxiproxyClient.
The run's toxiproxy is recorded by `install!` in the ctx's `:faults`
atom, {run {:url :proxies [name]}}: in memory only, the stack ops
install again when they re-adopt a run. The hc-6 stack ops call it after
bringing toxiproxy up (`promote.faults/project-spec`) and connecting it
(`promote.faults/joins`), with the host URL of its published API port.
`:toxiproxy` in the ctx, (fn [url] IToxiproxyClient), builds the client;
it defaults to the HTTP adapter.(faults! ctx {:keys [op proxy toxic] :as req})Result of one faults request {:run :url :op add|remove|reset|list :proxy :toxic {:type :attributes :stream :toxicity :name}}: add answers the toxic, remove {:removed?}, reset {:reset true}, list {name Proxy}.
Result of one faults request {:run :url :op add|remove|reset|list
:proxy :toxic {:type :attributes :stream :toxicity :name}}:
add answers the toxic, remove {:removed?}, reset {:reset true}, list
{name Proxy}.(forget! ctx run)Drop the record of run's toxiproxy (its stack went down).
Drop the record of `run`'s toxiproxy (its stack went down).
(install! ctx p url)Result<{:run :url :proxies [Proxy]}>: create every proxy of faults plan
p in the toxiproxy at url and record the run's toxiproxy. A plan that
interposes nothing is a no-op.
Result<{:run :url :proxies [Proxy]}>: create every proxy of faults plan
`p` in the toxiproxy at `url` and record the run's toxiproxy. A plan that
interposes nothing is a no-op.(teardown! ctx p dir exec-step!)Result<{:run :steps [step]}>: undo plan p at stack-down, dir holding
the compose fragment it came up from. Runs each of
promote.faults/teardown through exec-step! ((fn [step] Result), the
hc-6 stack ops map :down-project to -down-project! and :network-rm to
-network-rm!), stopping at the first error, then forgets the run. A
plan that interposes nothing runs no step.
Result<{:run :steps [step]}>: undo plan `p` at stack-down, `dir` holding
the compose fragment it came up from. Runs each of
`promote.faults/teardown` through `exec-step!` ((fn [step] Result), the
hc-6 stack ops map :down-project to `-down-project!` and :network-rm to
`-network-rm!`), stopping at the first error, then forgets the run. A
plan that interposes nothing runs no step.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |