Skip to content

Commit

Permalink
doc: update circuit parameter documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lance committed Jun 10, 2019
1 parent 744da31 commit e342338
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 42 deletions.
57 changes: 34 additions & 23 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset='utf-8' />
<title>opossum 1.11.0 | Documentation</title>
<title>opossum 2.0.0 | Documentation</title>
<meta name='description' content='A fail-fast circuit breaker for promises and callbacks'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<link href='assets/bass.css' rel='stylesheet' />
Expand All @@ -15,7 +15,7 @@
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
<div class='py1 px2'>
<h3 class='mb0 no-anchor'>opossum</h3>
<div class='mb1'><code>1.11.0</code></div>
<div class='mb1'><code>2.0.0</code></div>
<input
placeholder='Filter'
id='filter-input'
Expand Down Expand Up @@ -484,7 +484,7 @@ <h1>opossum <a href="https://circleci.com/gh/nodeshift/opossum/tree/master"><img
</tr>
<tr>
<td>Engines:</td>
<td>Node.js 8.x, 10.x, 11.x</td>
<td>Node.js 8.x, 10.x, 11.x, 12.x</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -750,8 +750,8 @@ <h3 class='fl m0' id='factory'>
<tr>
<td class='break-word'><span class='code bold'>options.maxFailures</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></code>
</td>
<td class='break-word'><span>The number of times the circuit can fail
before opening. Default 10.
<td class='break-word'><span>(Deprecated) The number of times the
circuit can fail before opening. Default 10.
</span></td>
</tr>

Expand All @@ -764,6 +764,7 @@ <h3 class='fl m0' id='factory'>
setting the breaker to
<code>halfOpen</code>
state, and trying the action again.
Default: 30000 (30 seconds)
</span></td>
</tr>

Expand Down Expand Up @@ -796,7 +797,8 @@ <h3 class='fl m0' id='factory'>
<tr>
<td class='break-word'><span class='code bold'>options.name</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code>
</td>
<td class='break-word'><span>the circuit name to use when reporting stats
<td class='break-word'><span>the circuit name to use when reporting stats.
Default: the name of the function this circuit controls.
</span></td>
</tr>

Expand All @@ -822,7 +824,9 @@ <h3 class='fl m0' id='factory'>
options.capacity, further calls to
<code>fire()</code>
are rejected until at least one
of the current requests completes.
of the current requests completes. Default:
<code>Number.MAX_SAFE_INTEGER</code>
.
</span></td>
</tr>

Expand All @@ -833,6 +837,7 @@ <h3 class='fl m0' id='factory'>
</td>
<td class='break-word'><span>the error percentage at
which to open the circuit and start short-circuiting requests to fallback.
Default: 50
</span></td>
</tr>

Expand Down Expand Up @@ -1086,8 +1091,8 @@ <h3 class='fl m0' id='circuitbreaker'>
<tr>
<td class='break-word'><span class='code bold'>options.maxFailures</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></code>
</td>
<td class='break-word'><span>The number of times the circuit can fail
before opening. Default 10.
<td class='break-word'><span>(Deprecated) The number of times the
circuit can fail before opening. Default 10.
</span></td>
</tr>

Expand All @@ -1100,6 +1105,7 @@ <h3 class='fl m0' id='circuitbreaker'>
setting the breaker to
<code>halfOpen</code>
state, and trying the action again.
Default: 30000 (30 seconds)
</span></td>
</tr>

Expand All @@ -1120,9 +1126,10 @@ <h3 class='fl m0' id='circuitbreaker'>
<td class='break-word'><span class='code bold'>options.rollingCountBuckets</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></code>
</td>
<td class='break-word'><span>Sets the number of buckets the
statistical window is divided into. So, if options.rollingCountTimeout is
10000, and options.rollingCountBuckets is 10, the statistical window will
be 1000 1 second snapshots in the statistical window. Default: 10
rolling statistical window is divided into. So, if
options.rollingCountTimeout is 10000, and options.rollingCountBuckets is 10,
then the statistical window will be 1000 1 second snapshots in the
statistical window. Default: 10
</span></td>
</tr>

Expand All @@ -1131,7 +1138,8 @@ <h3 class='fl m0' id='circuitbreaker'>
<tr>
<td class='break-word'><span class='code bold'>options.name</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code>
</td>
<td class='break-word'><span>the circuit name to use when reporting stats
<td class='break-word'><span>the circuit name to use when reporting stats.
Default: the name of the function this circuit controls.
</span></td>
</tr>

Expand All @@ -1140,10 +1148,10 @@ <h3 class='fl m0' id='circuitbreaker'>
<tr>
<td class='break-word'><span class='code bold'>options.rollingPercentilesEnabled</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code>
</td>
<td class='break-word'><span>indicates whether
execution latencies should be tracked and calculated as percentiles. If they
are disabled, all summary statistics (mean, percentiles) are returned as -1.
Default: false
<td class='break-word'><span>This property indicates
whether execution latencies should be tracked and calculated as percentiles.
If they are disabled, all summary statistics (mean, percentiles) are
returned as -1. Default: false
</span></td>
</tr>

Expand All @@ -1153,11 +1161,13 @@ <h3 class='fl m0' id='circuitbreaker'>
<td class='break-word'><span class='code bold'>options.capacity</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></code>
</td>
<td class='break-word'><span>the number of concurrent requests allowed.
If the number currently executing functions is equal to options.capacity,
further calls to
If the number currently executing function calls is equal to
options.capacity, further calls to
<code>fire()</code>
are rejected until at least one of the current
requests completes.
are rejected until at least one
of the current requests completes. Default:
<code>Number.MAX_SAFE_INTEGER</code>
.
</span></td>
</tr>

Expand All @@ -1168,6 +1178,7 @@ <h3 class='fl m0' id='circuitbreaker'>
</td>
<td class='break-word'><span>the error percentage at
which to open the circuit and start short-circuiting requests to fallback.
Default: 50
</span></td>
</tr>

Expand All @@ -1194,8 +1205,8 @@ <h3 class='fl m0' id='circuitbreaker'>
allow before enabling the circuit. This can help in situations where no
matter what your
<code>errorThresholdPercentage</code>
is, if the first execution times
out or fails, the circuit immediately opens. Default: 0
is, if the first execution
times out or fails, the circuit immediately opens. Default: 0
</span></td>
</tr>

Expand Down
45 changes: 26 additions & 19 deletions docs/opossum.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ Creates a [CircuitBreaker][6] instance capable of executing `action`.
- `options` **[Object][58]** Options for the [CircuitBreaker][6]
- `options.timeout` **[Number][59]** The time in milliseconds that action should
be allowed to execute before timing out. Default 10000 (10 seconds)
- `options.maxFailures` **[Number][59]** The number of times the circuit can fail
before opening. Default 10.
- `options.maxFailures` **[Number][59]** (Deprecated) The number of times the
circuit can fail before opening. Default 10.
- `options.resetTimeout` **[Number][59]** The time in milliseconds to wait before
setting the breaker to `halfOpen` state, and trying the action again.
Default: 30000 (30 seconds)
- `options.rollingCountTimeout` **[Number][59]** Sets the duration of the
statistical rolling window, in milliseconds. This is how long Opossum keeps
metrics for the circuit breaker to use and for publishing. Default: 10000
Expand All @@ -81,17 +82,19 @@ Creates a [CircuitBreaker][6] instance capable of executing `action`.
options.rollingCountTimeout is 10000, and options.rollingCountBuckets is 10,
then the statistical window will be 1000 1 second snapshots in the
statistical window. Default: 10
- `options.name` **[String][60]** the circuit name to use when reporting stats
- `options.name` **[String][60]** the circuit name to use when reporting stats.
Default: the name of the function this circuit controls.
- `options.rollingPercentilesEnabled` **[boolean][61]** This property indicates
whether execution latencies should be tracked and calculated as percentiles.
If they are disabled, all summary statistics (mean, percentiles) are
returned as -1. Default: false
- `options.capacity` **[Number][59]** the number of concurrent requests allowed.
If the number currently executing function calls is equal to
options.capacity, further calls to `fire()` are rejected until at least one
of the current requests completes.
of the current requests completes. Default: `Number.MAX_SAFE_INTEGER`.
- `options.errorThresholdPercentage` **[Number][59]** the error percentage at
which to open the circuit and start short-circuiting requests to fallback.
Default: 50
- `options.enabled` **[boolean][61]** whether this circuit is enabled upon
construction. Default: true
- `options.allowWarmUp` **[boolean][61]** determines whether to allow failures
Expand Down Expand Up @@ -144,36 +147,40 @@ Constructs a [CircuitBreaker][6].
- `options` **[Object][58]** Options for the [CircuitBreaker][6]
- `options.timeout` **[Number][59]** The time in milliseconds that action should
be allowed to execute before timing out. Default 10000 (10 seconds)
- `options.maxFailures` **[Number][59]** The number of times the circuit can fail
before opening. Default 10.
- `options.maxFailures` **[Number][59]** (Deprecated) The number of times the
circuit can fail before opening. Default 10.
- `options.resetTimeout` **[Number][59]** The time in milliseconds to wait before
setting the breaker to `halfOpen` state, and trying the action again.
Default: 30000 (30 seconds)
- `options.rollingCountTimeout` **[Number][59]** Sets the duration of the
statistical rolling window, in milliseconds. This is how long Opossum keeps
metrics for the circuit breaker to use and for publishing. Default: 10000
- `options.rollingCountBuckets` **[Number][59]** Sets the number of buckets the
statistical window is divided into. So, if options.rollingCountTimeout is
10000, and options.rollingCountBuckets is 10, the statistical window will
be 1000 1 second snapshots in the statistical window. Default: 10
- `options.name` **[String][60]** the circuit name to use when reporting stats
- `options.rollingPercentilesEnabled` **[boolean][61]** indicates whether
execution latencies should be tracked and calculated as percentiles. If they
are disabled, all summary statistics (mean, percentiles) are returned as -1.
Default: false
rolling statistical window is divided into. So, if
options.rollingCountTimeout is 10000, and options.rollingCountBuckets is 10,
then the statistical window will be 1000 1 second snapshots in the
statistical window. Default: 10
- `options.name` **[String][60]** the circuit name to use when reporting stats.
Default: the name of the function this circuit controls.
- `options.rollingPercentilesEnabled` **[boolean][61]** This property indicates
whether execution latencies should be tracked and calculated as percentiles.
If they are disabled, all summary statistics (mean, percentiles) are
returned as -1. Default: false
- `options.capacity` **[Number][59]** the number of concurrent requests allowed.
If the number currently executing functions is equal to options.capacity,
further calls to `fire()` are rejected until at least one of the current
requests completes.
If the number currently executing function calls is equal to
options.capacity, further calls to `fire()` are rejected until at least one
of the current requests completes. Default: `Number.MAX_SAFE_INTEGER`.
- `options.errorThresholdPercentage` **[Number][59]** the error percentage at
which to open the circuit and start short-circuiting requests to fallback.
Default: 50
- `options.enabled` **[boolean][61]** whether this circuit is enabled upon
construction. Default: true
- `options.allowWarmUp` **[boolean][61]** determines whether to allow failures
without opening the circuit during a brief warmup period (this is the
`rollingCountDuration` property). Default: false
allow before enabling the circuit. This can help in situations where no
matter what your `errorThresholdPercentage` is, if the first execution times
out or fails, the circuit immediately opens. Default: 0
matter what your `errorThresholdPercentage` is, if the first execution
times out or fails, the circuit immediately opens. Default: 0
- `options.volumeThreshold` **[Number][59]** the minimum number of requests within
the rolling statistical window that must exist before the circuit breaker
can open. This is similar to `options.allowWarmUp` in that no matter how many
Expand Down

0 comments on commit e342338

Please sign in to comment.