• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bucharest-gold / opossum / 174
100%

Build:
DEFAULT BRANCH: master
Ran 30 Mar 2017 03:56PM UTC
Jobs 2
Files 4
Run time 22s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
174

push

travis-ci

web-flow
feat: circuit status now contains a rolling window (#34)

* feat: circuit status now contains a rolling window

The rolling stats window is configurable in both total time sampled, and
how many snapshots, or buckets, within that time frame.

The new options that can be applied to a circuit breaker are
`rollingCountTimeout` and `rollingCountBuckets`, which default to 10000
and 10, respectively. So by default, the window is a statistical view
over the last 10 seconds, consisting of 10 one second snapshots.

The current circuit breaker status api has not been modified directly,
however the expected results are different. For example, you can still
do this:

```js
console.log(`Failure count: ${circuit.status.failures}`);
```

But that count will consist only of the number of failures within the
current snapshot.

To obtain stats for the entire window, use the `window` property.

```js
const stats = circuit.status.window;
```

This will give you an array containing the statistical sampling for the
entire window. So, given the defaults noted above, by default this will
be a ten element array, with each element containing an object with
sample data that looks something like this:

```js
{
  failures: 11,
  fallbacks: 9,
  successes: 3491,
  rejects: 2,
  fires: 3493,
  timeouts: 0,
  start: 1488999002013
}
```

* feat: add status listeners

Users can add a listener to a circuit's status object, which gets called
with the most recent status each time a new snapshot is created. Allows
users to maintain cumulative stats if they want to.

* chore: move increment function out of Status ctor

* bug: circuit should emit 'fire' even on cache hit.

* (feat) add isCircuitBreakerOpen property to stats

* chore: remove some redundant code

51 of 56 branches covered (91.07%)

187 of 190 relevant lines covered (98.42%)

52.98 hits per line

Jobs
ID Job ID Ran Files Coverage
1 174.1 30 Mar 2017 03:56PM UTC 0
98.42
Travis Job 174.1
2 174.2 30 Mar 2017 03:57PM UTC 0
98.42
Travis Job 174.2
Source Files on build 174
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #174
  • 05c0a2f8 on github
  • Prev Build on master (#170)
  • Next Build on master (#175)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc