@vtex/api 6.45.13-beta.6 → 6.45.14-beta.1
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/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
|
+
### Changed
|
|
10
|
+
- Deterministic cache for getWithBody
|
|
11
|
+
- Remove socket metrics per origin
|
|
9
12
|
|
|
10
13
|
## [6.45.12] - 2022-04-14
|
|
11
14
|
|
|
@@ -3,12 +3,9 @@ export declare class HttpAgentSingleton {
|
|
|
3
3
|
static getHttpAgent(): HttpAgent;
|
|
4
4
|
static httpAgentStats(): {
|
|
5
5
|
freeSockets: number;
|
|
6
|
-
freeSocketsPerOrigin: Record<string, number>;
|
|
7
6
|
pendingRequests: number;
|
|
8
|
-
pendingRequestsPerOrigin: Record<string, number>;
|
|
9
7
|
sockets: number;
|
|
10
|
-
socketsPerOrigin: Record<string, number>;
|
|
11
8
|
};
|
|
12
9
|
private static httpAgent;
|
|
13
|
-
private static
|
|
10
|
+
private static count;
|
|
14
11
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ramda_1 = require("ramda");
|
|
4
3
|
const agents_1 = require("../../agents");
|
|
5
4
|
class HttpAgentSingleton {
|
|
6
5
|
static getHttpAgent() {
|
|
@@ -10,27 +9,21 @@ class HttpAgentSingleton {
|
|
|
10
9
|
return HttpAgentSingleton.httpAgent;
|
|
11
10
|
}
|
|
12
11
|
static httpAgentStats() {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const freeSockets = ramda_1.sum(ramda_1.values(freeSocketsPerOrigin));
|
|
17
|
-
const pendingRequestsPerOrigin = HttpAgentSingleton.countPerOrigin(HttpAgentSingleton.httpAgent.requests);
|
|
18
|
-
const pendingRequests = ramda_1.sum(ramda_1.values(pendingRequestsPerOrigin));
|
|
12
|
+
const sockets = HttpAgentSingleton.count(HttpAgentSingleton.httpAgent.sockets);
|
|
13
|
+
const freeSockets = HttpAgentSingleton.count(HttpAgentSingleton.httpAgent.freeSockets);
|
|
14
|
+
const pendingRequests = HttpAgentSingleton.count(HttpAgentSingleton.httpAgent.requests);
|
|
19
15
|
return {
|
|
20
16
|
freeSockets,
|
|
21
|
-
freeSocketsPerOrigin,
|
|
22
17
|
pendingRequests,
|
|
23
|
-
pendingRequestsPerOrigin,
|
|
24
18
|
sockets,
|
|
25
|
-
socketsPerOrigin,
|
|
26
19
|
};
|
|
27
20
|
}
|
|
28
|
-
static
|
|
21
|
+
static count(obj) {
|
|
29
22
|
try {
|
|
30
|
-
return
|
|
23
|
+
return Object.values(obj).reduce((acc, val) => acc += val.length, 0);
|
|
31
24
|
}
|
|
32
25
|
catch (_) {
|
|
33
|
-
return
|
|
26
|
+
return 0;
|
|
34
27
|
}
|
|
35
28
|
}
|
|
36
29
|
}
|