Comparing version 1.0.1 to 1.0.2
@@ -40,3 +40,3 @@ 'use strict'; | ||
this.on('close', function () { | ||
function reset() { | ||
clearTimeout(timer); | ||
@@ -49,4 +49,6 @@ this._pendingClose = false; | ||
}); | ||
}); | ||
} | ||
this.on('half_open', reset); | ||
this.on('close', reset); | ||
this.close(); | ||
@@ -53,0 +55,0 @@ }; |
{ | ||
"name": "levee", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A circuitbreaker implementation for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -154,16 +154,33 @@ Levee | ||
A simple data aggregation object. | ||
#### Methods | ||
##### `increment(name)` | ||
Increment a named counter. | ||
- `name` - the label of the counter to increment. | ||
##### `decrement(name)` | ||
Decrement a named counter. | ||
- `name` - the label of the counter to decrement. | ||
##### `sample(name, value)` | ||
Take a sample of a given value. | ||
- `name` - the label of the sample being recorded. | ||
- `value` - the sample value being recorded. | ||
##### `snapshot()` | ||
Get the current state of the current Stats instance. Returns an object with the following properties: | ||
- `counts` - A map of names to current count values. | ||
- `samples` - A map of names to current sample averages and counts, in the form of: `{ average: 0, count, 0 }` | ||
##### `reset()` | ||
Resets all counts and samples. | ||
##### `resetCounts([name])` | ||
Reset counts for the provided name. If no name is provided, resets all counts. | ||
- `name` - the label of the count to reset. | ||
##### `resetSamples([name])` | ||
##### `resetSamples([name])` | ||
Reset samples for the provided name. If no name is provided, resets all samples. | ||
- `name` - the label of the sample to reset. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14086
248
185