@vtex/api 6.51.0 → 6.51.1-beta
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.
|
@@ -23,21 +23,11 @@ const statusTrackHandler = async (ctx) => {
|
|
|
23
23
|
};
|
|
24
24
|
exports.statusTrackHandler = statusTrackHandler;
|
|
25
25
|
const trackStatus = () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
// Flushing resets the metric accumulators, the CPU usage baseline and the
|
|
27
|
+
// incoming request stats, so it must keep running even though nothing
|
|
28
|
+
// consumes the returned metrics anymore.
|
|
29
|
+
global.metrics.statusTrack();
|
|
29
30
|
};
|
|
30
31
|
exports.trackStatus = trackStatus;
|
|
31
32
|
const broadcastStatusTrack = () => Object.values(cluster_1.default.workers).forEach(worker => worker === null || worker === void 0 ? void 0 : worker.send(STATUS_TRACK));
|
|
32
33
|
exports.broadcastStatusTrack = broadcastStatusTrack;
|
|
33
|
-
const logStatus = (status) => console.log(JSON.stringify({
|
|
34
|
-
__VTEX_IO_LOG: true,
|
|
35
|
-
account: constants_1.ACCOUNT,
|
|
36
|
-
app: constants_1.APP.ID,
|
|
37
|
-
isLink: constants_1.LINKED,
|
|
38
|
-
pid: process.pid,
|
|
39
|
-
production: constants_1.PRODUCTION,
|
|
40
|
-
status,
|
|
41
|
-
type: 'metric/status',
|
|
42
|
-
workspace: constants_1.WORKSPACE,
|
|
43
|
-
}));
|