Jepsen 0.3.5
Released under the Eclipse Public License
Distributed systems testing framework.
Installation
To install, add the following dependency to your project or build file:
[jepsen "0.3.5"]
Namespaces
jepsen.adya
Moved to jepsen.tests.adya.
+Generated by Codox
Jepsen 0.3.6
Jepsen 0.3.6
Released under the Eclipse Public License
Distributed systems testing framework.
Installation
To install, add the following dependency to your project or build file:
[jepsen "0.3.6"]
Namespaces
jepsen.checker
Validates that a history is correct with respect to some model.
Public variables and functions:
- check-safe
- Checker
- clock-plot
- compose
- concurrency-limit
- counter
- expand-queue-drain-ops
- frequency-distribution
- latency-graph
- linearizable
- log-file-pattern
- merge-valid
- noop
- perf
- queue
- rate-graph
- set
- set-full
- set-full-add
- set-full-element
- set-full-element-results
- set-full-read-absent
- set-full-read-present
- set-full-results
- stats
- stats-fold
- total-queue
- unbridled-optimism
- unhandled-exceptions
- unique-ids
- valid-priorities
jepsen.checker.perf
Supporting functions for performance analysis.
@@ -20,13 +20,13 @@Public variables and functions:
jepsen.control.util
Utility functions for scripting installations.
jepsen.core
Entry point for all Jepsen tests. Coordinates the setup of servers, running tests, creating and resolving failures, and interpreting results.
jepsen.db
Allows Jepsen to set up and tear down databases.
-jepsen.faketime
Libfaketime is useful for making clocks run at differing rates! This namespace provides utilities for stubbing out programs with faketime.
+jepsen.faketime
Libfaketime is useful for making clocks run at differing rates! This namespace provides utilities for stubbing out programs with faketime.
Public variables and functions:
jepsen.fs-cache
Some systems Jepsen tests are expensive or time-consuming to set up. They might involve lengthy compilation processes, large packages which take a long time to download, or allocate large files on initial startup.
Public variables and functions:
jepsen.generator
Public variables and functions:
- all-processes
- all-threads
- any
- clients
- concat
- context
- cycle
- cycle-times
- delay
- dissoc-vec
- each-thread
- each-thread-ensure-context-filters!
- extend-protocol-runtime
- f-map
- fill-in-op
- filter
- flip-flop
- fn-wrapper
- free-processes
- free-threads
- friendly-exceptions
- Generator
- init!
- initialized?
- limit
- log
- map
- mix
- nemesis
- on
- on-threads
- on-threads-context
- on-update
- once
- phases
- process->thread
- process-limit
- rand-int-seq
- repeat
- reserve
- sleep
- some-free-process
- soonest-op-map
- stagger
- synchronize
- then
- thread->process
- time-limit
- trace
- tracking-get!
- until-ok
- validate
jepsen.generator.context
Generators work with an immutable context that tells them what time it is, what processes are available, what process is executing which thread and vice versa, and so on. We need an efficient, high-performance data structure to track this information. This namespace provides that data structure, and functions to alter it.
+Public variables and functions:
- all-processes
- all-threads
- any
- clients
- concat
- context
- cycle
- cycle-times
- delay
- dissoc-vec
- each-process
- each-thread
- each-thread-ensure-context-filters!
- extend-protocol-runtime
- f-map
- fill-in-op
- filter
- flip-flop
- fn-wrapper
- free-processes
- free-threads
- friendly-exceptions
- Generator
- init!
- initialized?
- limit
- log
- map
- mix
- nemesis
- on
- on-threads
- on-threads-context
- on-update
- once
- phases
- process->thread
- process-limit
- rand-int-seq
- rand-seq
- repeat
- reserve
- sleep
- some-free-process
- soonest-op-map
- stagger
- synchronize
- then
- thread->process
- time-limit
- trace
- tracking-get!
- until-ok
- validate
jepsen.generator.context
Generators work with an immutable context that tells them what time it is, what processes are available, what process is executing which thread and vice versa, and so on. We need an efficient, high-performance data structure to track this information. This namespace provides that data structure, and functions to alter it.
jepsen.generator.interpreter
This namespace interprets operations from a pure generator, handling worker threads, spawning processes for interacting with clients and nemeses, and recording a history.
Public variables and functions:
jepsen.generator.test
This namespace contains functions for testing generators. See the jepsen.generator-test
namespace in the test/
directory for a concrete example of how these functions can be used.
Public variables and functions:
jepsen.generator.translation-table
We burn a lot of time in hashcode and map manipulation for thread names, which are mostly integers 0…n, but sometimes non-integer names like :nemesis. It’s nice to be able to represent thread state internally as purely integers. To do this, we compute a one-time translation table which lets us map those names to integers and vice-versa.
+Public variables and functions:
jepsen.generator.translation-table
We burn a lot of time in hashcode and map manipulation for thread names, which are mostly integers 0…n, but sometimes non-integer names like :nemesis. It’s nice to be able to represent thread state internally as purely integers. To do this, we compute a one-time translation table which lets us map those names to integers and vice-versa.
Public variables and functions:
jepsen.independent
Some tests are expensive to check–for instance, linearizability–which requires we verify only short histories. But if histories are short, we may not be able to sample often or long enough to reveal concurrency errors. This namespace supports splitting a test into independent components–for example taking a test of a single register and lifting it to a map of keys to registers.
Public variables and functions:
jepsen.lazyfs
Lazyfs allows the injection of filesystem-level faults: specifically, losing data which was written to disk but not fsynced. This namespace lets you mount a specific directory as a lazyfs filesystem, and offers a DB which mounts/unmounts it, and downloads the lazyfs log file–this can be composed into your own database. You can then call lose-unfsynced-writes! as a part of your database’s db/kill! implementation, likely after killing your DB process itself.
Public variables and functions:
jepsen.nemesis
Public variables and functions:
- bisect
- bitflip
- bitflip-dir
- bridge
- clock-scrambler
- complete-grudge
- compose
- f-map
- hammer-time
- invert-grudge
- majorities-ring
- majorities-ring-perfect
- majorities-ring-stochastic
- Nemesis
- node-start-stopper
- noop
- partition-halves
- partition-majorities-ring
- partition-random-halves
- partition-random-node
- partitioner
- Reflection
- set-time!
- split-one
- timeout
- truncate-file
- validate
jepsen.nemesis.combined
A nemesis which combines common operations on nodes and processes: clock skew, crashes, pauses, and partitions. So far, writing these sorts of nemeses has involved lots of special cases. I expect that the API for specifying these nemeses is going to fluctuate as we figure out how to integrate those special cases appropriately. Consider this API unstable.
@@ -43,7 +43,8 @@Public variables and functions:
jepsen.reconnect
Stateful wrappers for automatically reconnecting network clients.
Public variables and functions:
jepsen.role
Supports tests where each node has a single, distinct role. For instance, one node might run ZooKeeper, and the remaining nodes might run Kafka.
+Public variables and functions:
jepsen.store
Persistent storage for test runs and later analysis.
Public variables and functions:
- all-tests
- base-dir
- class-name->ns-str
- close!
- console-appender
- default-edn-reader
- default-logging-overrides
- default-nonserializable-keys
- delete!
- delete-file-recursively!
- dir?
- edn-tag->constructor
- file-name
- fressian-file
- fressian-file!
- jepsen-file
- jepsen-file!
- latest
- load
- load-fressian-file
- load-jepsen-file
- load-results
- load-results-edn
- memoized-edn-tag->constructor
- memoized-load-results
- migrate-to-jepsen-format!
- nonserializable-keys
- path
- path!
- read-handlers
- save-0!
- save-1!
- save-2!
- serializable-test
- start-logging!
- stop-logging!
- symlink?
- test
- test-names
- tests
- update-current-symlink!
- update-symlink!
- update-symlinks!
- virtual-dir?
- with-handle
- with-out-file
- write-fressian!
- write-fressian-file!
- write-handlers
- write-history!
- write-jepsen!
- write-results!
jepsen.store.format
Jepsen tests are logically a map. To save this map to disk, we originally wrote it as a single Fressian file. This approach works reasonably well, but has a few problems:
Public variables and functions:
- append-to-big-vector-block!
- append-to-fressian-stream-block!
- assoc-block!
- big-vector-block-writer!
- big-vector-block-writer-worker!
- big-vector-chunk-size
- big-vector-count-size
- big-vector-index-size
- block-checksum
- block-checksum-given-data-checksum
- block-checksum-offset
- block-checksum-size
- block-header
- block-header-checksum
- block-header-for-data
- block-header-for-length-and-checksum!
- block-header-length
- block-header-size
- block-header-type
- block-id-size
- block-index-data-size
- block-index-offset-offset
- block-len-offset
- block-len-size
- block-offset-size
- block-ref
- block-references
- block-type->short
- block-type-offset
- block-type-size
- check-block-checksum
- check-magic
- check-version!
- close!
- copy!
- current-version
- find-references
- first-block-offset
- flush!
- fressian-buffer-size
- fressian-read-handlers
- fressian-stream-block-writer!
- fressian-write-handlers
- gc!
- IPartialMap
- large-region-size
- load-block-index!
- magic
- magic-offset
- magic-size
- new-block-id!
- next-block-offset
- open
- prep-read!
- prep-write!
- read-big-vector-block
- read-block-by-id
- read-block-by-offset
- read-block-by-offset*
- read-block-data
- read-block-header
- read-block-index-block
- read-block-index-offset
- read-file
- read-fressian-block
- read-fressian-stream-block
- read-partial-map-block
- read-root
- read-test
- set-block-header-checksum!
- set-block-header-length!
- set-block-header-type!
- set-root!
- short->block-type
- test-history-writer!
- version
- version-offset
- version-size
- write-big-vector-block!
- write-block!
- write-block-data!
- write-block-header!
- write-block-index!
- write-block-index-offset!
- write-file!
- write-fressian-block!
- write-fressian-block!*
- write-fressian-to-file!
- write-header!
- write-initial-test!
- write-partial-map-block!
- write-partial-map-block!*
- write-test!
- write-test-with-history!
- write-test-with-results!
jepsen.store.fressian
Supports serialization of various Jepsen datatypes via Fressian.
Public variables and functions:
jepsen.tests
Provide utilities for writing tests using jepsen.
@@ -54,8 +55,8 @@Public variables and functions:
jepsen.tests.cycle.append
Detects cycles in histories where operations are transactions over named lists lists, and operations are either appends or reads. See elle.list-append for docs.
jepsen.tests.cycle.wr
A test which looks for cycles in write/read transactions. Writes are assumed to be unique, but this is the only constraint. See elle.rw-register for docs.
jepsen.tests.kafka
This workload is intended for systems which behave like the popular Kafka queue. This includes Kafka itself, as well as compatible systems like Redpanda.
-Public variables and functions:
- allowed-error-types
- analysis
- around-key-offset
- around-key-value
- around-some
- assocv
- checker
- condense-error
- consume-counts
- crash-client-gen
- cycles!
- duplicate-cases
- final-polls
- g1a-cases
- graph
- index-seq
- int-poll-skip+nonmonotonic-cases
- int-send-skip+nonmonotonic-cases
- interleave-subscribes
- key-order-viz
- log->last-index->values
- log->value->first-index
- lost-write-cases
- mop-index
- must-have-committed?
- nonmonotonic-send-cases
- nth+
- op->max-offsets
- op->max-poll-offsets
- op->max-send-offsets
- op->thread
- op-around-key-offset
- op-around-key-value
- op-pairs
- op-read-offsets
- op-read-pairs
- op-reads
- op-reads-helper
- op-write-offsets
- op-write-pairs
- op-writes
- op-writes-helper
- plot-realtime-lag!
- plot-realtime-lags!
- plot-unseen!
- poll-skip+nonmonotonic-cases
- poll-unseen
- previous-value
- readers-of
- reads-by-type
- reads-of-key
- reads-of-key-offset
- reads-of-key-value
- realtime-lag
- render-order-viz!
- stats-checker
- strip-types
- subscribe-ratio
- tag-rw
- track-key-offsets
- txn-generator
- unseen
- version-orders
- version-orders-reduce-mop
- version-orders-update-log
- workload
- worst-realtime-lag
- wr-graph
- writer-of
- writes-by-type
- writes-of-key
- writes-of-key-offset
- writes-of-key-value
- ww-graph
jepsen.tests.linearizable-register
Common generators and checkers for linearizability over a set of independent registers. Clients should understand three functions, for writing a value, reading a value, and compare-and-setting a value from v to v’. Reads receive nil
, and replace it with the value actually read.
Public variables and functions:
- allowed-error-types
- analysis
- around-key-offset
- around-key-value
- around-some
- assocv
- checker
- condense-error
- consume-counts
- crash-client-gen
- cycles!
- datafy-version-order-log
- downsample-plot
- duplicate-cases
- final-polls
- firstv
- g1a-cases
- graph
- index-seq
- int-poll-skip+nonmonotonic-cases
- int-poll-skip+nonmonotonic-cases-per-key
- int-send-skip+nonmonotonic-cases
- interleave-subscribes
- key-order-viz
- log->last-index->values
- log->value->first-index
- lost-write-cases
- mop-index
- must-have-committed?
- nonmonotonic-send-cases
- nth+
- op->max-offsets
- op->max-poll-offsets
- op->max-send-offsets
- op->thread
- op-around-key-offset
- op-around-key-value
- op-pairs
- op-read-offsets
- op-read-pairs
- op-reads
- op-reads-helper
- op-reads-index
- op-write-offsets
- op-write-pairs
- op-writes
- op-writes-helper
- plot-bounds
- plot-realtime-lag!
- plot-realtime-lags!
- plot-unseen!
- poll-skip+nonmonotonic-cases
- poll-skip+nonmonotonic-cases-per-process
- poll-unseen
- precommitted-read-cases
- previous-value
- readers-of
- reads-by-type
- reads-of-key
- reads-of-key-offset
- reads-of-key-value
- realtime-lag
- render-order-viz!
- secondv
- stats-checker
- strip-types
- tag-rw
- track-key-offsets
- txn-generator
- unseen
- version-orders
- version-orders-reduce-mop
- version-orders-update-log
- workload
- worst-realtime-lag
- wr-graph
- writer-of
- writes-by-type
- writes-of-key
- writes-of-key-offset
- writes-of-key-value
- ww-graph
jepsen.tests.linearizable-register
Common generators and checkers for linearizability over a set of independent registers. Clients should understand three functions, for writing a value, reading a value, and compare-and-setting a value from v to v’. Reads receive nil
, and replace it with the value actually read.
jepsen.tests.long-fork
Tests for an anomaly in parallel snapshot isolation (but which is prohibited in normal snapshot isolation). In long-fork, concurrent write transactions are observed in conflicting order. For example:
jepsen.util
Kitchen sink
-Public variables and functions:
- *relative-time-origin*
- all-jdk-loggers
- arities
- await-fn
- buf-size
- chunk-vec
- coll
- compare<
- concat-files!
- contains-many?
- deepfind
- default
- drop-common-proper-prefix
- ex-root-cause
- exception?
- fast-last
- fcatch
- fixed-point
- forget!
- forgettable
- fraction
- get-named-lock!
- history->latencies
- inc*
- integer-interval-set-str
- lazy-atom
- letr
- letr-let-if
- letr-partition-bindings
- letr-rewrite-return
- linear-time-nanos
- local-time
- log
- log-op
- log-print
- logger
- longest-common-prefix
- majority
- map-keys
- map-kv
- map-vals
- max-by
- maybe-number
- meh
- min-by
- minority-third
- ms->nanos
- mute
- mute-jdk
- name+
- named-locks
- nanos->ms
- nanos->secs
- nemesis-intervals
- op->str
- parse-long
- poly-compare
- polysort
- pprint-str
- print-history
- prn-op
- processors
- pwrite-history!
- rand-distribution
- rand-exp
- rand-nth-empty
- random-nonempty-subset
- real-pmap
- relative-time-nanos
- retry
- secs->nanos
- sequential
- sh
- sleep
- spy
- test->str
- time-
- timeout
- uninteresting-exceptions
- with-named-lock
- with-relative-time
- with-retry
- with-thread-name
- write-history!
jepsen.web
Web server frontend for browsing test results.
+Public variables and functions:
- *relative-time-origin*
- all-jdk-loggers
- arities
- await-fn
- buf-size
- chunk-vec
- coll
- compare<
- concat-files!
- contains-many?
- deepfind
- default
- drop-common-proper-prefix
- ex-root-cause
- exception?
- extreme-by*
- fast-last
- fcatch
- fixed-point
- forget!
- forgettable
- fraction
- get-named-lock!
- history->latencies
- inc*
- integer-interval-set-str
- lazy-atom
- letr
- letr-let-if
- letr-partition-bindings
- letr-rewrite-return
- linear-time-nanos
- local-time
- log
- log-op
- log-print
- logger
- longest-common-prefix
- majority
- map-keys
- map-kv
- map-vals
- max-by
- maybe-number
- meh
- min-by
- minority-third
- ms->nanos
- mute
- mute-jdk
- name+
- named-locks
- nanos->ms
- nanos->secs
- nemesis-intervals
- nil-if-empty
- op->str
- parse-long
- partition-by-vec
- poly-compare
- polysort
- pprint-str
- print-history
- prn-op
- processors
- pwrite-history!
- rand-distribution
- rand-exp
- rand-nth-empty
- random-nonempty-subset
- real-pmap
- relative-time-nanos
- retry
- secs->nanos
- sequential
- sh
- sleep
- spy
- test->str
- time-
- timeout
- uninteresting-exceptions
- with-named-lock
- with-relative-time
- with-retry
- with-thread-name
- write-history!
jepsen.web
Web server frontend for browsing test results.
Public variables and functions:
- app
- assert-file-in-scope!
- basic-date-time
- clj-escape
- colors
- content-type
- dir
- dir-cell
- dir-sort
- e404
- fast-tests
- file-cell
- file-url
- files
- home
- js-escape
- page-limit
- params
- parse-time
- relative-path
- serve!
- test-cache
- test-cache-key
- test-cache-mutable-window
- test-header
- test-row
- url
- url-encode-path-components
- valid-color
- zip
- zip-path!
Generated by Codox
Jepsen 0.3.5
jepsen.adya
Moved to jepsen.tests.adya.
+Generated by Codox
Jepsen 0.3.6
jepsen.adya
Moved to jepsen.tests.adya.
Generated by Codox
Jepsen 0.3.5
jepsen.checker.clock
Helps analyze clock skew over time.
+Generated by Codox
Jepsen 0.3.6
jepsen.checker.clock
Helps analyze clock skew over time.
history->datasets
(history->datasets history)
Takes a history and produces a map of nodes to sequences of t offset pairs, representing the changing clock offsets for that node over time.
-plot!
(plot! test history opts)
Plots clock offsets over time. Looks for any op with a :clock-offset field, which contains a (possible incomplete) map of nodes to offsets, in seconds. Plots those offsets over time.
-short-node-names
(short-node-names nodes)
Takes a collection of node names, and maps them to shorter names by removing common trailing strings (e.g. common domains).
-plot!
(plot! test history opts)
Plots clock offsets over time. Looks for any op with a :clock-offset field, which contains a (possible incomplete) map of nodes to offsets, in seconds. Plots those offsets over time.
+short-node-names
(short-node-names nodes)
Takes a collection of node names, and maps them to shorter names by removing common trailing strings (e.g. common domains).
+Generated by Codox
Jepsen 0.3.5
jepsen.checker
Validates that a history is correct with respect to some model.
+Generated by Codox
Jepsen 0.3.6
jepsen.checker
Validates that a history is correct with respect to some model.
check-safe
(check-safe checker test history)
(check-safe checker test history opts)
Like check, but wraps exceptions up and returns them as a map like
-{:valid? :unknown :error “…”}
-Checker
protocol
members
check
(check checker test history opts)
Verify the history is correct. Returns a map like
+{:valid? :unknown :error {:via {:type clojure.lang.Exceptioninfo, …} …}
+Checker
protocol
members
check
(check checker test history opts)
Verify the history is correct. Returns a map like
{:valid? true}
or
{:valid? false :some-details … :failed-at details of specific operations}
Opts is a map of options controlling checker execution. Keys include:
:subdirectory - A directory within this test’s store directory where output files should be written. Defaults to nil.
-compose
(compose checker-map)
Takes a map of names to checkers, and returns a checker which runs each check (possibly in parallel) and returns a map of names to results; plus a top-level :valid? key which is true iff every checker considered the history valid.
-concurrency-limit
(concurrency-limit limit checker)
Takes positive integer limit and a checker. Puts an upper bound on the number of concurrent executions of this checker. Use this when a checker is particularly thread or memory intensive, to reduce context switching and memory cost.
-counter
(counter)
A counter starts at zero; add operations should increment it by that much, and reads should return the present value. This checker validates that at each read, the value is greater than the sum of all :ok increments, and lower than the sum of all attempted increments.
+compose
(compose checker-map)
Takes a map of names to checkers, and returns a checker which runs each check (possibly in parallel) and returns a map of names to results; plus a top-level :valid? key which is true iff every checker considered the history valid.
+concurrency-limit
(concurrency-limit limit checker)
Takes positive integer limit and a checker. Puts an upper bound on the number of concurrent executions of this checker. Use this when a checker is particularly thread or memory intensive, to reduce context switching and memory cost.
+counter
(counter)
A counter starts at zero; add operations should increment it by that much, and reads should return the present value. This checker validates that at each read, the value is greater than the sum of all :ok increments, and lower than the sum of all attempted increments.
Note that this counter verifier assumes the value monotonically increases: decrements are not allowed.
Returns a map:
:valid? Whether the counter remained within bounds :reads [lower-bound read-value upper-bound …] :errors [lower-bound read-value upper-bound …]
; Not implemented, but might be nice:
:max-absolute-error The lower read upper where read falls furthest outside :max-relative-error Same, but with error computed as a fraction of the mean}
-expand-queue-drain-ops
(expand-queue-drain-ops)
A Tesser fold which looks for :drain operations with their value being a collection of queue elements, and expands them to a sequence of :dequeue invoke/complete pairs.
-frequency-distribution
(frequency-distribution points c)
Computes a map of percentiles (0–1, not 0–100, we’re not monsters) of a collection of numbers, taken at percentiles points
. If the collection is empty, returns nil.
latency-graph
(latency-graph)
(latency-graph opts)
Spits out graphs of latencies. Checker options take precedence over those passed in with this constructor.
-linearizable
(linearizable {:keys [algorithm model]})
Validates linearizability with Knossos. Defaults to the competition checker, but can be controlled by passing either :linear or :wgl.
+expand-queue-drain-ops
(expand-queue-drain-ops)
A Tesser fold which looks for :drain operations with their value being a collection of queue elements, and expands them to a sequence of :dequeue invoke/complete pairs.
+frequency-distribution
(frequency-distribution points c)
Computes a map of percentiles (0–1, not 0–100, we’re not monsters) of a collection of numbers, taken at percentiles points
. If the collection is empty, returns nil.
latency-graph
(latency-graph)
(latency-graph opts)
Spits out graphs of latencies. Checker options take precedence over those passed in with this constructor.
+linearizable
(linearizable {:keys [algorithm model]})
Validates linearizability with Knossos. Defaults to the competition checker, but can be controlled by passing either :linear or :wgl.
Takes an options map for arguments, ex. {:model (model/cas-register) :algorithm :wgl}
-log-file-pattern
(log-file-pattern pattern filename)
Takes a PCRE regular expression pattern (as a Pattern or string) and a filename. Checks the store directory for this test, and in each node directory (e.g. n1), examines the given file to see if it contains instances of the pattern. Returns :valid? true if no instances are found, and :valid? false otherwise, along with a :count of the number of matches, and a :matches list of maps, each with the node and matching string from the file.
+log-file-pattern
(log-file-pattern pattern filename)
Takes a PCRE regular expression pattern (as a Pattern or string) and a filename. Checks the store directory for this test, and in each node directory (e.g. n1), examines the given file to see if it contains instances of the pattern. Returns :valid? true if no instances are found, and :valid? false otherwise, along with a :count of the number of matches, and a :matches list of maps, each with the node and matching string from the file.
(log-file-pattern-checker #“panic: (\w+)$” “db.log”)
{:valid? false :count 5 :matches {:node “n1” :line “panic: invariant violation” “invariant violation” …]}}
-merge-valid
(merge-valid valids)
Merge n :valid values, yielding the one with the highest priority.
-perf
(perf)
(perf opts)
Composes various performance statistics. Checker options take precedence over those passed in with this constructor.
-queue
(queue model)
Every dequeue must come from somewhere. Validates queue operations by assuming every non-failing enqueue succeeded, and only OK dequeues succeeded, then reducing the model with that history. Every subhistory of every queue should obey this property. Should probably be used with an unordered queue model, because we don’t look for alternate orderings. O(n).
-rate-graph
(rate-graph)
(rate-graph opts)
Spits out graphs of throughput over time. Checker options take precedence over those passed in with this constructor.
-set
(set)
Given a set of :add operations followed by a final :read, verifies that every successfully added element is present in the read, and that the read contains only elements for which an add was attempted.
-set-full
(set-full)
(set-full checker-opts)
A more rigorous set analysis. We allow :add operations which add a single element, and :reads which return all elements present at that time. For each element, we construct a timeline like so:
+merge-valid
(merge-valid valids)
Merge n :valid values, yielding the one with the highest priority.
+perf
(perf)
(perf opts)
Composes various performance statistics. Checker options take precedence over those passed in with this constructor.
+queue
(queue model)
Every dequeue must come from somewhere. Validates queue operations by assuming every non-failing enqueue succeeded, and only OK dequeues succeeded, then reducing the model with that history. Every subhistory of every queue should obey this property. Should probably be used with an unordered queue model, because we don’t look for alternate orderings. O(n).
+rate-graph
(rate-graph)
(rate-graph opts)
Spits out graphs of throughput over time. Checker options take precedence over those passed in with this constructor.
+set
(set)
Given a set of :add operations followed by a final :read, verifies that every successfully added element is present in the read, and that the read contains only elements for which an add was attempted.
+set-full
(set-full)
(set-full checker-opts)
A more rigorous set analysis. We allow :add operations which add a single element, and :reads which return all elements present at that time. For each element, we construct a timeline like so:
[nonexistent] ... [created] ... [present] ... [absent] ... [present] ...
For each element:
@@ -80,20 +80,20 @@ element was known to be inserted, but never observed. -set-full-element
(set-full-element op)
Given an add invocation, constructs a new set element state record to track that element
-set-full-element-results
(set-full-element-results e)
Takes a SetFullElement and computes a map of final results from it:
+set-full-element
(set-full-element op)
Given an add invocation, constructs a new set element state record to track that element
+set-full-element-results
(set-full-element-results e)
Takes a SetFullElement and computes a map of final results from it:
:element The element itself :outcome :stable, :lost, :never-read :lost-latency :stable-latency
-set-full-results
(set-full-results opts elements)
Takes options from set-full, and a collection of SetFullElements. Computes agggregate results; see set-full for details.
-stats
(stats)
Computes basic statistics about success and failure rates, both overall and broken down by :f. Results are valid only if every :f has at some :ok operations; otherwise they’re :unknown.
-total-queue
(total-queue)
What goes in must come out. Verifies that every successful enqueue has a successful dequeue. Queues only obey this property if the history includes draining them completely. O(n).
-unhandled-exceptions
(unhandled-exceptions)
Returns information about unhandled exceptions: a sequence of maps sorted in descending frequency order, each with:
+set-full-results
(set-full-results opts elements)
Takes options from set-full, and a collection of SetFullElements. Computes agggregate results; see set-full for details.
+stats
(stats)
Computes basic statistics about success and failure rates, both overall and broken down by :f. Results are valid only if every :f has at some :ok operations; otherwise they’re :unknown.
+total-queue
(total-queue)
What goes in must come out. Verifies that every successful enqueue has a successful dequeue. Queues only obey this property if the history includes draining them completely. O(n).
+unhandled-exceptions
(unhandled-exceptions)
Returns information about unhandled exceptions: a sequence of maps sorted in descending frequency order, each with:
:class The class of the exception thrown
:count How many of this exception we observed
:example An example operation
-unique-ids
(unique-ids)
Checks that a unique id generator actually emits unique IDs. Expects a history with :f :generate invocations matched by :ok responses with distinct IDs for their :values. IDs should be comparable. Returns
+unique-ids
(unique-ids)
Checks that a unique id generator actually emits unique IDs. Expects a history with :f :generate invocations matched by :ok responses with distinct IDs for their :values. IDs should be comparable. Returns
{:valid? Were all IDs unique?
:attempted-count Number of attempted ID generation calls
:acknowledged-count Number of IDs actually returned successfully
@@ -102,5 +102,5 @@
they appeared--not complete for perf reasons :D
:range [lowest-id highest-id]}
-valid-priorities
A map of :valid? values to their importance. Larger numbers are considered more signficant and dominate when checkers are composed.
-valid-priorities
A map of :valid? values to their importance. Larger numbers are considered more signficant and dominate when checkers are composed.
+Generated by Codox
Jepsen 0.3.5
jepsen.checker.perf
Supporting functions for performance analysis.
+Generated by Codox
Jepsen 0.3.6
jepsen.checker.perf
Supporting functions for performance analysis.
broaden-range
(broaden-range [a b])
Given a lower upper range for a plot, returns lower’ upper’, which covers the original range, but slightly expanded, to fall nicely on integral boundaries.
-bucket-points
(bucket-points dt points)
Takes a time window dt and a sequence of time, _ points, and emits a seq of time, points-in-window buckets, ordered by time. Time is at the midpoint of the window.
-bucket-scale
(bucket-scale dt b)
Given a bucket size dt, and a bucket number (e.g. 0, 1, …), returns the time at the midpoint of that bucket.
-bucket-time
(bucket-time dt t)
Given a bucket size dt and a time t, computes the time at the midpoint of the bucket this time falls into.
-buckets
(buckets dt)
(buckets dt tmax)
Given a bucket size dt, emits a lazy sequence of times at the midpoints of each bucket.
-completions-by-f-type
(completions-by-f-type history)
Takes a history and returns a map of f -> type-> ops, for all completions in history.
-first-time
(first-time history)
Takes a history and returns the first :time in it, in seconds, as a double.
-fs->points
(fs->points fs)
Given a sequence of :f’s, yields a map of f -> gnuplot-point-type, so we can render each function in a different style.
-has-data?
(has-data? plot)
Takes a plot and returns true iff it has at least one series with data points.
-interval->times
(interval->times [a b])
Given an interval of two operations a b, returns the times time-a time-b covering the interval. If b is missing, yields time-a nil.
-invokes-by-f
(invokes-by-f)
(invokes-by-f history)
Takes a history and returns a map of f -> ops, for all invocations. Either a tesswer fold, or runs on a history.
-invokes-by-f-type
(invokes-by-f-type)
(invokes-by-f-type history)
A fold which returns a map of f -> type -> ops, for all invocations.
-invokes-by-type
(invokes-by-type)
(invokes-by-type history)
Splits up a sequence of invocations into ok, failed, and crashed ops by looking at their corresponding completions. Either a tesser fold, or runs on a history.
-latencies->quantiles
(latencies->quantiles dt qs points)
Takes a time window in seconds, a sequence of quantiles from 0 to 1, and a sequence of time, latency pairs. Groups pairs by their time window and emits a emits a map of quantiles to sequences of view source
bucket-points
(bucket-points dt points)
Takes a time window dt and a sequence of time, _ points, and emits a seq of time, points-in-window buckets, ordered by time. Time is at the midpoint of the window.
+bucket-scale
(bucket-scale dt b)
Given a bucket size dt, and a bucket number (e.g. 0, 1, …), returns the time at the midpoint of that bucket.
+bucket-time
(bucket-time dt t)
Given a bucket size dt and a time t, computes the time at the midpoint of the bucket this time falls into.
+buckets
(buckets dt)
(buckets dt tmax)
Given a bucket size dt, emits a lazy sequence of times at the midpoints of each bucket.
+completions-by-f-type
(completions-by-f-type history)
Takes a history and returns a map of f -> type-> ops, for all completions in history.
+first-time
(first-time history)
Takes a history and returns the first :time in it, in seconds, as a double.
+fs->points
(fs->points fs)
Given a sequence of :f’s, yields a map of f -> gnuplot-point-type, so we can render each function in a different style.
+has-data?
(has-data? plot)
Takes a plot and returns true iff it has at least one series with data points.
+interval->times
(interval->times [a b])
Given an interval of two operations a b, returns the times time-a time-b covering the interval. If b is missing, yields time-a nil.
+invokes-by-f
(invokes-by-f)
(invokes-by-f history)
Takes a history and returns a map of f -> ops, for all invocations. Either a tesswer fold, or runs on a history.
+invokes-by-f-type
(invokes-by-f-type)
(invokes-by-f-type history)
A fold which returns a map of f -> type -> ops, for all invocations.
+invokes-by-type
(invokes-by-type)
(invokes-by-type history)
Splits up a sequence of invocations into ok, failed, and crashed ops by looking at their corresponding completions. Either a tesser fold, or runs on a history.
+latencies->quantiles
(latencies->quantiles dt qs points)
Takes a time window in seconds, a sequence of quantiles from 0 to 1, and a sequence of time, latency pairs. Groups pairs by their time window and emits a emits a map of quantiles to sequences of time, latency-at-that-quantile pairs, one per time window.
-latency-point
(latency-point op)
Given an operation, returns a time, latency pair: times in seconds, latencies in ms.
-latency-preamble
(latency-preamble test output-path)
Gnuplot commands for setting up a latency plot.
-legend-part
(legend-part series)
Takes a series map and returns the list of gnuplot commands to render that series.
-nemesis-activity
(nemesis-activity nemeses history)
Given a nemesis specification and a history, partitions the set of nemesis operations in the history into different nemeses, as per the spec. Returns the spec, restricted to just those non-hidden nemeses taking part in this history, and with each spec augmented with two keys:
+latency-point
(latency-point op)
Given an operation, returns a time, latency pair: times in seconds, latencies in ms.
+latency-preamble
(latency-preamble test output-path)
Gnuplot commands for setting up a latency plot.
+legend-part
(legend-part series)
Takes a series map and returns the list of gnuplot commands to render that series.
+nemesis-activity
(nemesis-activity nemeses history)
Given a nemesis specification and a history, partitions the set of nemesis operations in the history into different nemeses, as per the spec. Returns the spec, restricted to just those non-hidden nemeses taking part in this history, and with each spec augmented with two keys:
:ops All operations the nemeses performed :intervals A set of start end paired ops.
-nemesis-lines
(nemesis-lines plot nemeses)
Given nemesis activity, emits a sequence of gnuplot commands rendering vertical lines where nemesis events occurred.
-nemesis-ops
(nemesis-ops nemeses history)
Given a history and a nemeses specification, partitions the set of nemesis operations in the history into different nemeses, as per the spec. Returns the nemesis spec, restricted to just those nemeses taking part in this history, and with each spec augmented with an :ops key, which contains all operations that nemesis performed. Skips :hidden? nemeses.
-nemesis-regions
(nemesis-regions plot nemeses)
Given nemesis activity, emits a sequence of gnuplot commands rendering shaded regions where each nemesis was active. We can render a maximum of 12 nemeses; this keeps size and spacing consistent.
-nemesis-series
(nemesis-series plot nemeses)
Given nemesis activity, constructs the series required to show every present nemesis’ activity in the legend. We do this by constructing dummy data, and a key that will match the way that nemesis’s activity is rendered.
-nemesis-lines
(nemesis-lines plot nemeses)
Given nemesis activity, emits a sequence of gnuplot commands rendering vertical lines where nemesis events occurred.
+nemesis-ops
(nemesis-ops nemeses history)
Given a history and a nemeses specification, partitions the set of nemesis operations in the history into different nemeses, as per the spec. Returns the nemesis spec, restricted to just those nemeses taking part in this history, and with each spec augmented with an :ops key, which contains all operations that nemesis performed. Skips :hidden? nemeses.
+nemesis-regions
(nemesis-regions plot nemeses)
Given nemesis activity, emits a sequence of gnuplot commands rendering shaded regions where each nemesis was active. We can render a maximum of 12 nemeses; this keeps size and spacing consistent.
+nemesis-series
(nemesis-series plot nemeses)
Given nemesis activity, constructs the series required to show every present nemesis’ activity in the legend. We do this by constructing dummy data, and a key that will match the way that nemesis’s activity is rendered.
+plot!
(plot! opts)
Renders a gnuplot plot. Takes an option map:
:preamble Gnuplot commands to send first :series A vector of series maps :draw-fewer-on-top? If passed, renders series with fewer points on top :xrange A pair xmin xmax which controls the xrange :yrange Ditto, for the y axis :logscale e.g. :y
A series map is a map with:
:data A sequence of data points to render, e,g. [0 0 1 2 2 4] :with How to draw this series, e.g. ’points :linetype What kind of line to use :pointtype What kind of point to use :title A string, or nil, to label this series map
-point-graph!
(point-graph! test history {:keys [subdirectory nemeses], :as opts})
Writes a plot of raw latency data points.
-qs->colors
(qs->colors qs)
Given a sequence of quantiles q, yields a map of q -> gnuplot-color, so we can render each latency curve in a different color.
-quantiles
(quantiles qs points)
Takes a sequence of quantiles from 0 to 1 and a sequence of values, and returns a map of quantiles to values at those quantiles.
-quantiles-graph!
(quantiles-graph! test history {:keys [subdirectory nemeses]})
Writes a plot of latency quantiles, by f, over time.
-rate
(rate history)
Map breaking down the mean rate of completions by f and type, plus totals at each level.
-rate-graph!
(rate-graph! test history {:keys [subdirectory nemeses]})
Writes a plot of operation rate by their completion times.
-rate-preamble
(rate-preamble test output-path)
Gnuplot commands for setting up a rate plot.
-with-nemeses
(with-nemeses plot history nemeses)
Augments a plot map to render nemesis activity. Takes a nemesis specification: a collection of nemesis spec maps, each of which has keys:
+point-graph!
(point-graph! test history {:keys [subdirectory nemeses], :as opts})
Writes a plot of raw latency data points.
+qs->colors
(qs->colors qs)
Given a sequence of quantiles q, yields a map of q -> gnuplot-color, so we can render each latency curve in a different color.
+quantiles
(quantiles qs points)
Takes a sequence of quantiles from 0 to 1 and a sequence of values, and returns a map of quantiles to values at those quantiles.
+quantiles-graph!
(quantiles-graph! test history {:keys [subdirectory nemeses]})
Writes a plot of latency quantiles, by f, over time.
+rate
(rate history)
Map breaking down the mean rate of completions by f and type, plus totals at each level.
+rate-graph!
(rate-graph! test history {:keys [subdirectory nemeses]})
Writes a plot of operation rate by their completion times.
+rate-preamble
(rate-preamble test output-path)
Gnuplot commands for setting up a rate plot.
+with-nemeses
(with-nemeses plot history nemeses)
Augments a plot map to render nemesis activity. Takes a nemesis specification: a collection of nemesis spec maps, each of which has keys:
:name A string uniquely naming this nemesis :color What color to use for drawing this nemesis (e.g. “#abcd01”) :start A set of :f’s which begin this nemesis’ activity :stop A set of :f’s which end this nemesis’ activity :fs A set of :f’s otherwise related to this nemesis :hidden? Skips rendering this nemesis.
-with-range
(with-range plot)
Takes a plot object. Where xrange or yrange are not provided, fills them in by iterating over each series :data.
-without-empty-series
(without-empty-series plot)
Takes a plot, and strips out empty series objects.
-with-range
(with-range plot)
Takes a plot object. Where xrange or yrange are not provided, fills them in by iterating over each series :data.
+without-empty-series
(without-empty-series plot)
Takes a plot, and strips out empty series objects.
+Generated by Codox
Jepsen 0.3.5
jepsen.checker.timeline
Renders an HTML timeline of a history.
-breadcrumbs
(breadcrumbs test history-key)
Renders a series of back links increasing in depth
-op-limit
Maximum number of operations to render. Helps make timeline usable on massive histories.
-pair->div
(pair->div history test process-index [start stop])
Turns a pair of start/stop operations into a div.
-pairs
(pairs history)
(pairs invocations [op & ops])
Pairs up ops from each process in a history. Yields a lazy sequence of info or invoke, ok|fail|info pairs.
-render-op-extra-keys
(render-op-extra-keys op)
Helper for render-op which renders keys we didn’t explicitly print
-sub-index
(sub-index history)
Attaches a :sub-index key to each element of this timeline’s subhistory, identifying its relative position.
-Generated by Codox
Jepsen 0.3.6
jepsen.checker.timeline
Renders an HTML timeline of a history.
+breadcrumbs
(breadcrumbs test history-key)
Renders a series of back links increasing in depth
+op-limit
Maximum number of operations to render. Helps make timeline usable on massive histories.
+pair->div
(pair->div history test process-index [start stop])
Turns a pair of start/stop operations into a div.
+pairs
(pairs history)
(pairs invocations [op & ops])
Pairs up ops from each process in a history. Yields a lazy sequence of info or invoke, ok|fail|info pairs.
+render-op-extra-keys
(render-op-extra-keys op)
Helper for render-op which renders keys we didn’t explicitly print
+sub-index
(sub-index history)
Attaches a :sub-index key to each element of this timeline’s subhistory, identifying its relative position.
+Generated by Codox
Jepsen 0.3.5
jepsen.cli
Command line interface. Provides a default main method for common Jepsen functions (like the web interface), and utility functions for Jepsen tests to create their own test runners.
-merge-opt-specs
(merge-opt-specs a b)
Takes two option specifications and merges them together. Where both offer the same option name, prefers the latter.
-one-of
(one-of coll)
Takes a collection and returns a string like “Must be one of …” and a list of names. For maps, uses keys.
-parse-concurrency
(parse-concurrency parsed)
(parse-concurrency parsed k)
Takes a parsed map. Parses :concurrency; if it is a string ending with n, e.g 3n, sets it to 3 * the number of :nodes. Otherwise, parses as a plain integer. With an optional keyword k, parses that key in the parsed map–by default, the key is :concurrency.
-parse-nodes
(parse-nodes parsed)
Takes a parsed map and merges all the various node specifications together. In particular:
+Generated by Codox
Jepsen 0.3.6
jepsen.cli
Command line interface. Provides a default main method for common Jepsen functions (like the web interface), and utility functions for Jepsen tests to create their own test runners.
+merge-opt-specs
(merge-opt-specs a b)
Takes two option specifications and merges them together. Where both offer the same option name, prefers the latter.
+one-of
(one-of coll)
Takes a collection and returns a string like “Must be one of …” and a list of names. For maps, uses keys.
+parse-concurrency
(parse-concurrency parsed)
(parse-concurrency parsed k)
Takes a parsed map. Parses :concurrency; if it is a string ending with n, e.g 3n, sets it to 3 * the number of :nodes. Otherwise, parses as a plain integer. With an optional keyword k, parses that key in the parsed map–by default, the key is :concurrency.
+parse-nodes
(parse-nodes parsed)
Takes a parsed map and merges all the various node specifications together. In particular:
- If :nodes-file and :nodes are blank, and :node is the default node list, uses the default node list.
- Otherwise, merges together :nodes-file, :nodes, and :node into a single list.
The new parsed map will have a merged nodes list in :nodes, and lose :nodes-file and :node options.
-rename-keys
(rename-keys m replacements)
Given a map m, and a map of keys to replacement keys, yields m with keys renamed.
-rename-options
(rename-options parsed replacements)
Like rename-keys, but takes a parsed map and updates keys in :options.
-rename-ssh-options
(rename-ssh-options parsed)
Takes a parsed map and moves SSH options to a map under :ssh.
-repeated-opt
(repeated-opt short-opt long-opt docstring default)
(repeated-opt short-opt long-opt docstring default parse-map)
Helper for vector options where we want to replace the default vector (checking via identical?) if any options are passed, building a vector for multiple args. If parse-map is provided (a map of string cmdline options to parsed values), the special word “all” can be used to specify every value in the map.
-run!
(run! subcommands [command & arguments :as argv])
Parses arguments and runs tests, etc. Takes a map of subcommand names to subcommand-specs, and a list of arguments. Each subcommand-spec is a map with the following keys:
+rename-keys
(rename-keys m replacements)
Given a map m, and a map of keys to replacement keys, yields m with keys renamed.
+rename-options
(rename-options parsed replacements)
Like rename-keys, but takes a parsed map and updates keys in :options.
+rename-ssh-options
(rename-ssh-options parsed)
Takes a parsed map and moves SSH options to a map under :ssh.
+repeated-opt
(repeated-opt short-opt long-opt docstring default)
(repeated-opt short-opt long-opt docstring default parse-map)
Helper for vector options where we want to replace the default vector (checking via identical?) if any options are passed, building a vector for multiple args. If parse-map is provided (a map of string cmdline options to parsed values), the special word “all” can be used to specify every value in the map.
+run!
(run! subcommands [command & arguments :as argv])
Parses arguments and runs tests, etc. Takes a map of subcommand names to subcommand-specs, and a list of arguments. Each subcommand-spec is a map with the following keys:
:opt-spec - The option parsing spec to use. :opt-fn - A function to transform the tools.cli options map, e.g. {:options …, :arguments …, :summary …}. Default: identity :usage - A usage string (default: “Usage:”) :run - Function to execute with the transformed options (default: pprint)
If an unrecognized (or no command) is given, prints out a general usage guide and exits.
For a subcommand, if help or –help is given, prints out a help string with usage for the given subcommand and exits with status 0.
If invalid arguments are given, prints those errors to the console, and exits with status 254.
Finally, if everything looks good, calls the given subcommand’s run
function with parsed options, and exits with status 0.
Catches exceptions, logs them to the console, and exits with status 255.
-single-test-cmd
(single-test-cmd opts)
A command which runs a single test with standard built-ins. Options:
+single-test-cmd
(single-test-cmd opts)
A command which runs a single test with standard built-ins. Options:
{:opt-spec A vector of additional options for tools.cli. Merge into test-opt-spec
. Optional. :opt-fn A function which transforms parsed options. Composed after test-opt-fn
. Optional. :opt-fn* Replaces test-opt-fn, in case you want to override it altogether. :tarball If present, adds a –tarball option to this command, defaulting to whatever URL is given here. :usage Defaults to jc/test-usage
. Optional. :test-fn A function that receives the option map and constructs a test.}
This comes with two commands: test
, which runs a test and analyzes it, and analyze
, which constructs a test map using the same arguments as run
, but analyzes a history from disk instead.
test-all-cmd
(test-all-cmd opts)
A command that runs a whole suite of tests in one go. Options:
+test-all-cmd
(test-all-cmd opts)
A command that runs a whole suite of tests in one go. Options:
:opt-spec A vector of additional options for tools.cli. Appended to test-opt-spec. Optional. :opt-fn A function which transforms parsed options. Composed after test-opt-fn. Optional. :opt-fn* Replaces test-opt-fn, instead of composing with it. :usage Defaults to test-usage
. Optional. :tests-fn A function that receives the transformed option map and constructs a sequence of tests to run.
test-all-exit!
(test-all-exit! results)
Takes a map of statuses and exits with an appropriate error code: 255 if any crashed, 2 if any were unknown, 1 if any were invalid, 0 if all passed.
-test-all-print-summary!
(test-all-print-summary! results)
Prints a summary of test outcomes. Takes a map of statuses (e.g. :crashed, true, false, :unknown), to test files. Returns results.
-test-all-run-tests!
(test-all-run-tests! tests)
Runs a sequence of tests and returns a map of outcomes (e.g. true, :unknown, :crashed, false) to collections of test folders with that outcome.
-test-opt-fn
(test-opt-fn parsed)
An opt fn for running simple tests. Remaps ssh keys, remaps :node to :nodes, reads :nodes-file into :nodes, and parses :concurrency.
-validate-tarball
(validate-tarball parsed)
Takes a parsed map and ensures a tarball is present.
-test-all-exit!
(test-all-exit! results)
Takes a map of statuses and exits with an appropriate error code: 255 if any crashed, 2 if any were unknown, 1 if any were invalid, 0 if all passed.
+test-all-print-summary!
(test-all-print-summary! results)
Prints a summary of test outcomes. Takes a map of statuses (e.g. :crashed, true, false, :unknown), to test files. Returns results.
+test-all-run-tests!
(test-all-run-tests! tests)
Runs a sequence of tests and returns a map of outcomes (e.g. true, :unknown, :crashed, false) to collections of test folders with that outcome.
+test-opt-fn
(test-opt-fn parsed)
An opt fn for running simple tests. Remaps ssh keys, remaps :node to :nodes, reads :nodes-file into :nodes, and parses :concurrency.
+validate-tarball
(validate-tarball parsed)
Takes a parsed map and ensures a tarball is present.
+Generated by Codox
Jepsen 0.3.5
jepsen.client
Applies operations to a database.
+Generated by Codox
Jepsen 0.3.6
jepsen.client
Applies operations to a database.
Client
protocol
members
close!
(close! client test)
Close the client connection when work is completed or an invocation crashes the client. Close should not affect the logical state of the test.
invoke!
(invoke! client test operation)
Apply an operation to the client, returning an operation to be appended to the history. For multi-stage operations, the client may reach into the test and conj onto the history atom directly.
open!
(open! client test node)
Set up the client to work with a particular node. Returns a client which is ready to accept operations via invoke! Open should not affect the logical state of the test; it should not, for instance, modify tables or insert records.
setup!
(setup! client test)
Called to set up database state for testing.
teardown!
(teardown! client test)
Tear down database state when work is complete.
-is-reusable?
(is-reusable? client test)
Wrapper around reusable?; returns false when not implemented.
-Reusable
protocol
members
reusable?
(reusable? client test)
If true, this client can be re-used with a fresh process after a call to invoke
throws or returns an info
operation. If false (or if this protocol is not implemented), crashed clients will be closed and new ones opened to replace them.
timeout
(timeout timeout-or-fn client)
Sometimes a client library’s own timeouts don’t work reliably. This takes either a timeout as a number of ms, or a function (f op) => timeout-in-ms, and a client. Wraps that client in a new one which automatically times out operations that take longer than the given timeout. Timed out operations have :error :jepsen.client/timeout.
-validate
(validate client)
Wraps a client, validating that its return types are what you’d expect.
-with-client
macro
(with-client [client-sym client-expr] & body)
Analogous to with-open. Takes a binding of the form view source
is-reusable?
(is-reusable? client test)
Wrapper around reusable?; returns false when not implemented.
+Reusable
protocol
members
reusable?
(reusable? client test)
If true, this client can be re-used with a fresh process after a call to invoke
throws or returns an info
operation. If false (or if this protocol is not implemented), crashed clients will be closed and new ones opened to replace them.
timeout
(timeout timeout-or-fn client)
Sometimes a client library’s own timeouts don’t work reliably. This takes either a timeout as a number of ms, or a function (f op) => timeout-in-ms, and a client. Wraps that client in a new one which automatically times out operations that take longer than the given timeout. Timed out operations have :error :jepsen.client/timeout.
+validate
(validate client)
Wraps a client, validating that its return types are what you’d expect.
+with-client
macro
(with-client [client-sym client-expr] & body)
Analogous to with-open. Takes a binding of the form client-sym client-expr, and a body. Binds client-sym to client-expr (presumably, client-expr opens a new client), evaluates body with client-sym bound, and ensures client is closed before returning.
-Generated by Codox
Jepsen 0.3.5
jepsen.codec
Serializes and deserializes objects to/from bytes.
+Generated by Codox
Jepsen 0.3.6
jepsen.codec
Serializes and deserializes objects to/from bytes.
Generated by Codox
Jepsen 0.3.5
jepsen.control.clj-ssh
A CLJ-SSH powered implementation of the Remote protocol.
+Generated by Codox
Jepsen 0.3.6
jepsen.control.clj-ssh
A CLJ-SSH powered implementation of the Remote protocol.
clj-ssh-agent
Acquiring an SSH agent is expensive and involves a global lock; we save the agent and re-use it to speed things up.
-clj-ssh-session
(clj-ssh-session conn-spec)
Opens a raw session to the given connection spec
-concurrency-limit
OpenSSH has a standard limit of 10 concurrent channels per connection. However, commands run in quick succession with 10 concurrent also seem to blow out the channel limit–perhaps there’s an asynchronous channel teardown process. We set the limit a bit lower here. This is experimentally determined for clj-ssh by running jepsen.control-test’s integration test…
with-errors
macro
(with-errors conn context & body)
Takes a conn spec, a context map, and a body. Evals body, remapping clj-ssh exceptions to :type :jepsen.control/ssh-failed.
-clj-ssh-session
(clj-ssh-session conn-spec)
Opens a raw session to the given connection spec
+concurrency-limit
OpenSSH has a standard limit of 10 concurrent channels per connection. However, commands run in quick succession with 10 concurrent also seem to blow out the channel limit–perhaps there’s an asynchronous channel teardown process. We set the limit a bit lower here. This is experimentally determined for clj-ssh by running jepsen.control-test’s integration test…
with-errors
macro
(with-errors conn context & body)
Takes a conn spec, a context map, and a body. Evals body, remapping clj-ssh exceptions to :type :jepsen.control/ssh-failed.
+Generated by Codox
Jepsen 0.3.5
jepsen.control.core
Provides the base protocol for running commands on remote nodes, as well as common functions for constructing and evaluating shell commands.
+Generated by Codox
Jepsen 0.3.6
jepsen.control.core
Provides the base protocol for running commands on remote nodes, as well as common functions for constructing and evaluating shell commands.
env
(env env)
We often want to construct env vars for a process. This function takes a map of environment variable names (any Named type, e.g. :HOME, “HOME”) to values (which are coerced using (str value)
), and constructs a Literal string, suitable for passing to exec, which binds those environment variables.
Callers of this function (especially indirectly, as with start-stop-daemon), may wish to construct env var strings themselves. Passing a string s
to this function simply returns (lit s)
. Passing a Literal l
to this function returns l
. nil is passed through unchanged.
escape
(escape s)
Escapes a thing for the shell.
Nils are empty strings.
Literal wrappers are passed through directly.
The special keywords :>, :>>, and :< map to their corresponding shell I/O redirection operators.
Named things like keywords and symbols use their name, escaped. Strings are escaped like normal.
Sequential collections and sets have each element escaped and space-separated.
-Remote
protocol
Remotes allow jepsen.control to run shell commands, upload, and download files. They use a context map, which encodes the current user, directory, etc:
+Remote
protocol
Remotes allow jepsen.control to run shell commands, upload, and download files. They use a context map, which encodes the current user, directory, etc:
:dir - The directory to execute remote commands in :sudo - The user we want to execute a command as :password - The user’s password, for sudo, if necessary.
members
connect
(connect this conn-spec)
Set up the remote to work with a particular node. Returns a Remote which is ready to accept actions via execute!
and upload!
and download!
. conn-spec is a map of:
{:host :post :username :password :private-key-path :strict-host-key-checking}
@@ -24,6 +24,6 @@:exit The command’s exit status. :out The stdout string. :err The stderr string.
upload!
(upload! this context local-paths remote-path opts)
Copy the specified local-path to the remote-path on the connected host.
Opts is an option map. There are no defined options right now, but later we might introduce some for e.g. recursive uploads, compression, etc. This is also a place for Remote implementations to offer custom semantics.
-throw-on-nonzero-exit
(throw-on-nonzero-exit {:keys [exit action], :as result})
Throws when an SSH result has nonzero exit status.
-wrap-sudo
(wrap-sudo {:keys [sudo sudo-password]} cmd)
Takes a context map and a command action, and returns the command action, modified to wrap it in a sudo command, if necessary. Uses the context map’s :sudo and :sudo-password fields.
-