smart-home-engine 1.18.2 → 1.19.0
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as O}from"./monaco-langs-Dt8a9eeo.js";import{t as I}from"./index-
|
|
1
|
+
import{m as O}from"./monaco-langs-Dt8a9eeo.js";import{t as I}from"./index-xdnNresq.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
package/dist/web/index.html
CHANGED
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
}
|
|
173
173
|
})();
|
|
174
174
|
</script>
|
|
175
|
-
<script type="module" crossorigin src="/assets/index-
|
|
175
|
+
<script type="module" crossorigin src="/assets/index-xdnNresq.js"></script>
|
|
176
176
|
<link rel="modulepreload" crossorigin href="/assets/monaco-langs-Dt8a9eeo.js">
|
|
177
177
|
<link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
|
|
178
178
|
<link rel="stylesheet" crossorigin href="/assets/index-nf1nG74s.css">
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -328,6 +328,23 @@ let _mqttMsgCount = 0;
|
|
|
328
328
|
let _mqttMsgTs = Date.now();
|
|
329
329
|
let _prevCpuUsage = process.cpuUsage();
|
|
330
330
|
|
|
331
|
+
// perf_hooks — event loop utilization + delay histogram (always-on, minimal overhead)
|
|
332
|
+
const { PerformanceObserver, monitorEventLoopDelay, performance } = require('perf_hooks');
|
|
333
|
+
let _prevElu = performance.eventLoopUtilization();
|
|
334
|
+
const _elHisto = monitorEventLoopDelay({ resolution: 20 });
|
|
335
|
+
_elHisto.enable();
|
|
336
|
+
|
|
337
|
+
// GC observer — log only significant GC pauses (>=50ms); never spams on normal minor GCs
|
|
338
|
+
const _gcKinds = { 1: 'minor', 2: 'major', 4: 'incremental', 8: 'weaken' };
|
|
339
|
+
new PerformanceObserver((list) => {
|
|
340
|
+
for (const entry of list.getEntries()) {
|
|
341
|
+
if (entry.duration >= 50) {
|
|
342
|
+
const kind = _gcKinds[entry.detail?.kind] ?? 'gc';
|
|
343
|
+
log.warn(`GC ${kind} pause ${Math.round(entry.duration)}ms`);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}).observe({ type: 'gc', buffered: false });
|
|
347
|
+
|
|
331
348
|
// Register runtime stats provider for GET /she/status
|
|
332
349
|
require('./web/server').setStatsProvider(() => {
|
|
333
350
|
let topics = 0;
|
|
@@ -341,6 +358,11 @@ require('./web/server').setStatsProvider(() => {
|
|
|
341
358
|
const cpuDelta = process.cpuUsage(_prevCpuUsage);
|
|
342
359
|
_prevCpuUsage = process.cpuUsage();
|
|
343
360
|
const cpuPercent = elapsed > 0 ? Math.round(((cpuDelta.user + cpuDelta.system) / 1000 / (elapsed * 1000)) * 1000) / 10 : 0;
|
|
361
|
+
const eluDelta = performance.eventLoopUtilization(_prevElu);
|
|
362
|
+
_prevElu = performance.eventLoopUtilization();
|
|
363
|
+
const elMeanMs = Math.round(_elHisto.mean / 1e6);
|
|
364
|
+
const elP99Ms = Math.round(_elHisto.percentile(99) / 1e6);
|
|
365
|
+
_elHisto.reset();
|
|
344
366
|
const mem = process.memoryUsage();
|
|
345
367
|
const memMb = Math.round(mem.rss / 1048576);
|
|
346
368
|
const core = shedb.getCore();
|
|
@@ -378,6 +400,9 @@ require('./web/server').setStatsProvider(() => {
|
|
|
378
400
|
handlers: subscriptions.length + varSubscriptions.length + mqttEventCallbacks.length,
|
|
379
401
|
memMb,
|
|
380
402
|
cpuPercent,
|
|
403
|
+
eluPercent: Math.round(eluDelta.utilization * 100),
|
|
404
|
+
elMeanMs,
|
|
405
|
+
elP99Ms,
|
|
381
406
|
};
|
|
382
407
|
});
|
|
383
408
|
|