@riddix/hamh 2.1.0-alpha.388 → 2.1.0-alpha.389
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/dist/backend/cli.js
CHANGED
|
@@ -149493,6 +149493,7 @@ function settingsApi(settingsStorage, envAuth) {
|
|
|
149493
149493
|
import { exec } from "node:child_process";
|
|
149494
149494
|
import os2 from "node:os";
|
|
149495
149495
|
import { promisify } from "node:util";
|
|
149496
|
+
import v8 from "node:v8";
|
|
149496
149497
|
import express11 from "express";
|
|
149497
149498
|
var execAsync = promisify(exec);
|
|
149498
149499
|
function detectEnvironment2() {
|
|
@@ -149548,9 +149549,11 @@ function systemApi(version) {
|
|
|
149548
149549
|
process: {
|
|
149549
149550
|
pid: process.pid,
|
|
149550
149551
|
uptime: process.uptime(),
|
|
149552
|
+
rss: memUsage.rss,
|
|
149551
149553
|
memoryUsage: memUsage.heapUsed,
|
|
149552
149554
|
heapTotal: memUsage.heapTotal,
|
|
149553
149555
|
heapUsed: memUsage.heapUsed,
|
|
149556
|
+
heapSizeLimit: v8.getHeapStatistics().heap_size_limit,
|
|
149554
149557
|
external: memUsage.external
|
|
149555
149558
|
}
|
|
149556
149559
|
};
|
|
@@ -150707,7 +150710,7 @@ import { getStates } from "home-assistant-js-websocket";
|
|
|
150707
150710
|
import { fromPairs, keyBy, keys, uniq, values } from "lodash-es";
|
|
150708
150711
|
|
|
150709
150712
|
// src/utils/log-memory.ts
|
|
150710
|
-
import
|
|
150713
|
+
import v82 from "node:v8";
|
|
150711
150714
|
var HEAP_PRESSURE_THRESHOLD = 0.85;
|
|
150712
150715
|
function logMemoryUsage(log, context) {
|
|
150713
150716
|
const mem = process.memoryUsage();
|
|
@@ -150719,7 +150722,7 @@ function logMemoryUsage(log, context) {
|
|
|
150719
150722
|
);
|
|
150720
150723
|
}
|
|
150721
150724
|
function isHeapUnderPressure() {
|
|
150722
|
-
const stats =
|
|
150725
|
+
const stats = v82.getHeapStatistics();
|
|
150723
150726
|
return stats.used_heap_size / stats.heap_size_limit > HEAP_PRESSURE_THRESHOLD;
|
|
150724
150727
|
}
|
|
150725
150728
|
|