Skip to content

Commit

Permalink
Minor fixes for doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tichon29 committed Nov 27, 2020
1 parent 37c2144 commit f643fa5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/content/api/module/breaker/sliding/count.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ For example, if the count window size is 10, the circular array has always 10 me
| permittedNumberOfCallsInHalfOpenState | Specifies the number of permitted calls when the circuit is half open | `2` |
| halfOpenStateMaxDelay | Specifies the maximum wait (in ms) in Half Open State, before switching back to open. 0 deactivates this | `0` |
| slidingWindowSize | Specifies the maximum number of calls used to calculate failure and slow call rate percentages | `10` |
| minimumNumberOfCalls | Specifies the minimum number of calls rrequused to calculate failure and slow call rate percentages | `10` |
| minimumNumberOfCalls | Specifies the minimum number of calls used to calculate failure and slow call rate percentages | `10` |
| openStateDelay | Specifies the time (in ms) the circuit stay opened before switching to half-open | `60000` |
| onError | Allows filtering the error to report as a failure or not. | `None` |
| onError | Allows filtering of the error to report as a failure or not. | `None` |

## Events

Expand Down
6 changes: 3 additions & 3 deletions docs/content/api/module/breaker/sliding/time.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ For example, if the count window size is 10000, the circular array stores the re
| slowCallDurationThreshold | Specifies the duration (in ms) threshold above which calls are considered as slow | `60000 (ms)` |
| permittedNumberOfCallsInHalfOpenState | Specifies the number of permitted calls when the circuit is half open | `2` |
| halfOpenStateMaxDelay | Specifies the maximum wait (in ms) in Half Open State, before switching back to open. 0 deactivates this | `0` |
| slidingWindowSize | Specifies the maximum number of calls used to calculate failure and slow call rate percentages | `10` |
| minimumNumberOfCalls | Specifies the minimum number of calls rrequused to calculate failure and slow call rate percentages | `10` |
| slidingWindowSize | Specifies the sliding duration (in ms) used to calculate failure and slow call rate percentages | `10` |
| minimumNumberOfCalls | Specifies the minimum number of calls used to calculate failure and slow call rate percentages | `10` |
| openStateDelay | Specifies the time (in ms) the circuit stay opened before switching to half-open | `60000` |
| onError | Allows filtering the error to report as a failure or not. | `None` |
| onError | Allows filtering of the error to report as a failure or not. | `None` |

## Events

Expand Down
16 changes: 8 additions & 8 deletions src/module/breaker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class BreakerError extends Error {
}

/**
* Returned when a breaker module is in half-open state and the maximum of requests has been sent.
* Returned when a breaker module is in half-open state and the maximum number of requests in half-open has been sent.
* @param message Max allowed requests reached
*/
export class BreakerMaxAllowedRequestError extends Error {
Expand Down Expand Up @@ -52,11 +52,11 @@ export abstract class SlidingWindowBreakerOptions extends ModuleOptions {
*/
halfOpenStateMaxDelay?: number;
/**
* Specifies the maximum number of calls used to calculate failure and slow call rate percentages
* Specifies the maximum number of calls (if count breaker is user), or the sliding duration (in ms, if time breaker is used) used to calculate failure and slow call rate percentages
*/
slidingWindowSize?: number;
/**
* Specifies the minimum number of calls rrequused to calculate failure and slow call rate percentages
* Specifies the minimum number of calls used to calculate failure and slow call rate percentages
*/
minimumNumberOfCalls?: number;
/**
Expand All @@ -76,7 +76,7 @@ export abstract class SlidingWindowBreakerOptions extends ModuleOptions {
*/
permittedNumberOfCallsInHalfOpenState?: number;
/**
* Allows filtering the error to report as a failure or not.
* Allows filtering of the error to report as a failure or not.
*/
onError?: ErrorCallback;
}
Expand All @@ -102,11 +102,11 @@ export abstract class SlidingWindowBreaker<T> extends Module {
*/
public halfOpenStateMaxDelay: number;
/**
* Specifies the maximum number of calls used to calculate failure and slow call rate percentages
* Specifies the maximum number of calls (if count breaker is user), or the sliding duration (in ms, if time breaker is used) used to calculate failure and slow call rate percentages
*/
public slidingWindowSize: number;
/**
* Specifies the minimum number of calls rrequused to calculate failure and slow call rate percentages
* Specifies the minimum number of calls used to calculate failure and slow call rate percentages
*/
public minimumNumberOfCalls: number;
/**
Expand All @@ -126,7 +126,7 @@ export abstract class SlidingWindowBreaker<T> extends Module {
*/
public permittedNumberOfCallsInHalfOpenState: number;
/**
* Allows filtering the error to report as a failure or not.
* Allows filtering of the error to report as a failure or not.
*/
public onError: ErrorCallback;
// Private Attributes
Expand Down Expand Up @@ -250,7 +250,7 @@ export abstract class SlidingWindowBreaker<T> extends Module {
protected checkResult(nbSlow: number, nbFailure: number, nbCalls: number, callbackFailure: (() => void), callbackSuccess?: (() => void)): void {
if (
(this.slowCallRateThreshold < 100 && (((nbSlow / nbCalls) * 100) >= this.slowCallRateThreshold)) ||
(this.failureRateThreshold < 100 && (((nbFailure / nbCalls) * 100)>= this.failureRateThreshold))
(this.failureRateThreshold < 100 && (((nbFailure / nbCalls) * 100) >= this.failureRateThreshold))
) {
callbackFailure();
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/module/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MapCache } from '../helpers/map-cache';
*/
export abstract class CacheOptions extends ModuleOptions {
/**
* The amount of time before a cached result is considered valid.
* The amount of time during which a cached result is considered valid.
*/
ttl?: number;
/**
Expand All @@ -22,7 +22,7 @@ export abstract class CacheOptions extends ModuleOptions {
export class Cache extends Module {
// Public Attributes
/**
* The amount of time before a cached result is considered valid.
* The amount of time during which a cached result is considered valid.
*/
public ttl: number;
// Private Attributes
Expand All @@ -31,13 +31,13 @@ export class Cache extends Module {
private _cacheInterval: number|null;
// Computed Attributes
/**
* The amount of time before the cache cleans itself up.
* Get the amount of time before the cache cleans itself up.
*/
get cacheClearInterval (): number {
return this._cacheClearInterval;
}
/**
* The amount of time before the cache cleans itself up.
* Set the amount of time before the cache cleans itself up.
*/
set cacheClearInterval (interval: number) {
this._cacheClearInterval = interval;
Expand Down
4 changes: 2 additions & 2 deletions src/module/timeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Circuit, CircuitFunction } from '../circuit';
*/
export abstract class TimeoutOptions extends ModuleOptions {
/**
* The amount of time before a the promise is rejected.
* The amount of time before a promise is rejected.
*/
delay?: number;
}
Expand All @@ -28,7 +28,7 @@ export class TimeoutError extends Error {
export class Timeout extends Module {
// Public Attributes
/**
* The amount of time before a the promise is rejected.
* The amount of time before a promise is rejected.
*/
public delay: number;
// Constructor
Expand Down

0 comments on commit f643fa5

Please sign in to comment.