influx 5.0.6 → 5.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/backoff/backoff.d.ts +15 -15
- package/lib/src/backoff/backoff.js +2 -2
- package/lib/src/backoff/exponential.d.ts +52 -52
- package/lib/src/backoff/exponential.js +40 -40
- package/lib/src/builder.d.ts +265 -265
- package/lib/src/builder.js +366 -366
- package/lib/src/doc.d.ts +315 -315
- package/lib/src/doc.js +340 -340
- package/lib/src/grammar/ds.d.ts +45 -45
- package/lib/src/grammar/ds.js +56 -56
- package/lib/src/grammar/escape.d.ts +25 -25
- package/lib/src/grammar/escape.js +108 -108
- package/lib/src/grammar/index.d.ts +3 -3
- package/lib/src/grammar/index.js +8 -8
- package/lib/src/grammar/times.d.ts +74 -74
- package/lib/src/grammar/times.js +325 -325
- package/lib/src/host.d.ts +26 -26
- package/lib/src/host.js +34 -34
- package/lib/src/index.d.ts +659 -659
- package/lib/src/index.js +870 -870
- package/lib/src/pool.d.ts +149 -149
- package/lib/src/pool.js +344 -344
- package/lib/src/results.d.ts +118 -118
- package/lib/src/results.js +146 -146
- package/lib/src/schema.d.ts +58 -58
- package/lib/src/schema.js +117 -117
- package/package.json +2 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export interface IBackoffStrategy {
|
|
2
|
-
/**
|
|
3
|
-
* getDelay returns the amount of delay of the current backoff.
|
|
4
|
-
*/
|
|
5
|
-
getDelay(): number;
|
|
6
|
-
/**
|
|
7
|
-
* Next is called when a failure occurs on a host to
|
|
8
|
-
* return the next backoff amount.
|
|
9
|
-
*/
|
|
10
|
-
next(): IBackoffStrategy;
|
|
11
|
-
/**
|
|
12
|
-
* Returns a strategy with a reset backoff counter.
|
|
13
|
-
*/
|
|
14
|
-
reset(): IBackoffStrategy;
|
|
15
|
-
}
|
|
1
|
+
export interface IBackoffStrategy {
|
|
2
|
+
/**
|
|
3
|
+
* getDelay returns the amount of delay of the current backoff.
|
|
4
|
+
*/
|
|
5
|
+
getDelay(): number;
|
|
6
|
+
/**
|
|
7
|
+
* Next is called when a failure occurs on a host to
|
|
8
|
+
* return the next backoff amount.
|
|
9
|
+
*/
|
|
10
|
+
next(): IBackoffStrategy;
|
|
11
|
+
/**
|
|
12
|
+
* Returns a strategy with a reset backoff counter.
|
|
13
|
+
*/
|
|
14
|
+
reset(): IBackoffStrategy;
|
|
15
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { IBackoffStrategy } from './backoff';
|
|
2
|
-
/**
|
|
3
|
-
* IExponentialOptions are passed into the ExponentialBackoff constructor. The
|
|
4
|
-
* backoff equation is, in general, min(max, initial ^ n), where `n` is
|
|
5
|
-
* an incremented backoff factor. The result of the equation is a delay
|
|
6
|
-
* given in milliseconds.
|
|
7
|
-
*
|
|
8
|
-
* @typedef {Object} IExponentialOptions
|
|
9
|
-
* @property {Number} initial The initial delay passed to the equation.
|
|
10
|
-
* @property {Number} random Random factor to subtract from the `n` count.
|
|
11
|
-
* @property {Number} max Max is the maximum value of the delay.
|
|
12
|
-
*/
|
|
13
|
-
export interface IExponentialOptions {
|
|
14
|
-
/**
|
|
15
|
-
* The initial delay passed to the equation.
|
|
16
|
-
*/
|
|
17
|
-
initial: number;
|
|
18
|
-
/**
|
|
19
|
-
* Random factor to subtract from the `n` count.
|
|
20
|
-
*/
|
|
21
|
-
random: number;
|
|
22
|
-
/**
|
|
23
|
-
* max is the maximum value of the delay.
|
|
24
|
-
*/
|
|
25
|
-
max: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @class
|
|
29
|
-
* @implements {IBackoffStrategy}
|
|
30
|
-
*/
|
|
31
|
-
export declare class ExponentialBackoff implements IBackoffStrategy {
|
|
32
|
-
protected options: IExponentialOptions;
|
|
33
|
-
private counter;
|
|
34
|
-
/**
|
|
35
|
-
* Creates a new exponential backoff strategy.
|
|
36
|
-
* @see https://en.wikipedia.org/wiki/Exponential_backoff
|
|
37
|
-
* @param {IExponentialOptions} options
|
|
38
|
-
*/
|
|
39
|
-
constructor(options: IExponentialOptions);
|
|
40
|
-
/**
|
|
41
|
-
* @inheritDoc
|
|
42
|
-
*/
|
|
43
|
-
getDelay(): number;
|
|
44
|
-
/**
|
|
45
|
-
* @inheritDoc
|
|
46
|
-
*/
|
|
47
|
-
next(): IBackoffStrategy;
|
|
48
|
-
/**
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
reset(): IBackoffStrategy;
|
|
52
|
-
}
|
|
1
|
+
import { IBackoffStrategy } from './backoff';
|
|
2
|
+
/**
|
|
3
|
+
* IExponentialOptions are passed into the ExponentialBackoff constructor. The
|
|
4
|
+
* backoff equation is, in general, min(max, initial ^ n), where `n` is
|
|
5
|
+
* an incremented backoff factor. The result of the equation is a delay
|
|
6
|
+
* given in milliseconds.
|
|
7
|
+
*
|
|
8
|
+
* @typedef {Object} IExponentialOptions
|
|
9
|
+
* @property {Number} initial The initial delay passed to the equation.
|
|
10
|
+
* @property {Number} random Random factor to subtract from the `n` count.
|
|
11
|
+
* @property {Number} max Max is the maximum value of the delay.
|
|
12
|
+
*/
|
|
13
|
+
export interface IExponentialOptions {
|
|
14
|
+
/**
|
|
15
|
+
* The initial delay passed to the equation.
|
|
16
|
+
*/
|
|
17
|
+
initial: number;
|
|
18
|
+
/**
|
|
19
|
+
* Random factor to subtract from the `n` count.
|
|
20
|
+
*/
|
|
21
|
+
random: number;
|
|
22
|
+
/**
|
|
23
|
+
* max is the maximum value of the delay.
|
|
24
|
+
*/
|
|
25
|
+
max: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @class
|
|
29
|
+
* @implements {IBackoffStrategy}
|
|
30
|
+
*/
|
|
31
|
+
export declare class ExponentialBackoff implements IBackoffStrategy {
|
|
32
|
+
protected options: IExponentialOptions;
|
|
33
|
+
private counter;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new exponential backoff strategy.
|
|
36
|
+
* @see https://en.wikipedia.org/wiki/Exponential_backoff
|
|
37
|
+
* @param {IExponentialOptions} options
|
|
38
|
+
*/
|
|
39
|
+
constructor(options: IExponentialOptions);
|
|
40
|
+
/**
|
|
41
|
+
* @inheritDoc
|
|
42
|
+
*/
|
|
43
|
+
getDelay(): number;
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
next(): IBackoffStrategy;
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
reset(): IBackoffStrategy;
|
|
52
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* @class
|
|
5
|
-
* @implements {IBackoffStrategy}
|
|
6
|
-
*/
|
|
7
|
-
var ExponentialBackoff = (function () {
|
|
8
|
-
/**
|
|
9
|
-
* Creates a new exponential backoff strategy.
|
|
10
|
-
* @see https://en.wikipedia.org/wiki/Exponential_backoff
|
|
11
|
-
* @param {IExponentialOptions} options
|
|
12
|
-
*/
|
|
13
|
-
function ExponentialBackoff(options) {
|
|
14
|
-
this.options = options;
|
|
15
|
-
this.counter = 0;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
ExponentialBackoff.prototype.getDelay = function () {
|
|
21
|
-
var count = this.counter - Math.round(Math.random() * this.options.random); // tslint:disable-line
|
|
22
|
-
return Math.min(this.options.max, this.options.initial * Math.pow(2, Math.max(count, 0)));
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
ExponentialBackoff.prototype.next = function () {
|
|
28
|
-
var next = new ExponentialBackoff(this.options);
|
|
29
|
-
next.counter = this.counter + 1;
|
|
30
|
-
return next;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
ExponentialBackoff.prototype.reset = function () {
|
|
36
|
-
return new ExponentialBackoff(this.options);
|
|
37
|
-
};
|
|
38
|
-
return ExponentialBackoff;
|
|
39
|
-
}());
|
|
40
|
-
exports.ExponentialBackoff = ExponentialBackoff;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* @class
|
|
5
|
+
* @implements {IBackoffStrategy}
|
|
6
|
+
*/
|
|
7
|
+
var ExponentialBackoff = (function () {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new exponential backoff strategy.
|
|
10
|
+
* @see https://en.wikipedia.org/wiki/Exponential_backoff
|
|
11
|
+
* @param {IExponentialOptions} options
|
|
12
|
+
*/
|
|
13
|
+
function ExponentialBackoff(options) {
|
|
14
|
+
this.options = options;
|
|
15
|
+
this.counter = 0;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
ExponentialBackoff.prototype.getDelay = function () {
|
|
21
|
+
var count = this.counter - Math.round(Math.random() * this.options.random); // tslint:disable-line
|
|
22
|
+
return Math.min(this.options.max, this.options.initial * Math.pow(2, Math.max(count, 0)));
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
ExponentialBackoff.prototype.next = function () {
|
|
28
|
+
var next = new ExponentialBackoff(this.options);
|
|
29
|
+
next.counter = this.counter + 1;
|
|
30
|
+
return next;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
ExponentialBackoff.prototype.reset = function () {
|
|
36
|
+
return new ExponentialBackoff(this.options);
|
|
37
|
+
};
|
|
38
|
+
return ExponentialBackoff;
|
|
39
|
+
}());
|
|
40
|
+
exports.ExponentialBackoff = ExponentialBackoff;
|