@camstack/system 1.2.175 → 1.2.177
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/addon-runner.js +2 -3
- package/dist/addon-runner.mjs +2 -3
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.d.ts +0 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +2 -40
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +2 -40
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-B25PDvaS.mjs → dist-C-8k9Z9W.mjs} +48 -37
- package/dist/{dist-BzPNEPHo.js → dist-DkVaJ5vG.js} +48 -37
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -4
- package/dist/index.mjs +3 -3
- package/dist/kernel/heap-allocation-sample.d.ts +107 -0
- package/dist/kernel/heap-spaces.d.ts +1 -6
- package/dist/{manifest-system-deps-Pw8iaY5X.mjs → manifest-system-deps-4NeY_8iQ.mjs} +3 -36
- package/dist/{manifest-system-deps-B0mzJPmb.js → manifest-system-deps-BbB94ozU.js} +2 -47
- package/dist/{retired-settings-keys-DZmeJ8ja.js → retired-settings-keys-B1ij-xtH.js} +1 -1
- package/dist/{retired-settings-keys-tWdiQpwa.mjs → retired-settings-keys-wfKn2-Sk.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
require("./dist-
|
|
2
|
+
require("./dist-DkVaJ5vG.js");
|
|
3
3
|
require("./hub-cap-forward-DmHNjbB0.js");
|
|
4
4
|
let node_crypto = require("node:crypto");
|
|
5
5
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
@@ -579,37 +579,14 @@ function formatHeapSpaces(spaces, minMb = 32) {
|
|
|
579
579
|
if (selected.length === 0) return "";
|
|
580
580
|
return ` ${selected.map((s) => `${heapSpaceField(s.name)}=${mb(s.usedBytes)}MB`).join(" ")}`;
|
|
581
581
|
}
|
|
582
|
-
/**
|
|
583
|
-
* Env var that authorises a heap snapshot on SIGUSR2.
|
|
584
|
-
*
|
|
585
|
-
* A snapshot is an admin mutation on a production hub: `writeHeapSnapshot`
|
|
586
|
-
* streams a file the size of the heap to `/tmp` and stops the world while it
|
|
587
|
-
* walks it — on the recorder that is a multi-GB file and a stall measured in
|
|
588
|
-
* seconds. The per-space breakdown is ~1.2 µs and changes nothing. Welding them
|
|
589
|
-
* to one signal priced the free answer at the cost of the expensive one.
|
|
590
|
-
*/
|
|
591
|
-
var RUNNER_HEAP_SNAPSHOT_ENV = "CAMSTACK_RUNNER_HEAP_SNAPSHOT";
|
|
592
|
-
/**
|
|
593
|
-
* Whether the operator has authorised the snapshot half of SIGUSR2.
|
|
594
|
-
*
|
|
595
|
-
* Explicit `'on'` only. Anything else — unset, empty, `'true'`, `'1'` — is NOT
|
|
596
|
-
* authorisation: a multi-GB stop-the-world write must never be reachable by a
|
|
597
|
-
* value someone set for a different purpose.
|
|
598
|
-
*/
|
|
599
|
-
function heapSnapshotAuthorised(env = process.env) {
|
|
600
|
-
return env[RUNNER_HEAP_SNAPSHOT_ENV] === "on";
|
|
601
|
-
}
|
|
602
582
|
var defaultDeps = {
|
|
603
583
|
readMemory: () => process.memoryUsage(),
|
|
604
584
|
readSpaces: readHeapSpaces,
|
|
605
|
-
writeSnapshot: (path) => {
|
|
606
|
-
node_v8.writeHeapSnapshot(path);
|
|
607
|
-
},
|
|
608
585
|
env: process.env
|
|
609
586
|
};
|
|
610
587
|
/**
|
|
611
588
|
* The SIGUSR2 report — memory + the FULL per-space breakdown, always; the
|
|
612
|
-
* snapshot
|
|
589
|
+
* snapshot NEVER — see the note in the body.
|
|
613
590
|
*
|
|
614
591
|
* The breakdown here keeps every non-empty space at 0.1 MB, unlike the
|
|
615
592
|
* heartbeat's filtered whole-MB pair: this is a hand-fired diagnostic read once
|
|
@@ -628,16 +605,6 @@ function emitHeapDiagnosticReport(request, deps = defaultDeps) {
|
|
|
628
605
|
} catch (error) {
|
|
629
606
|
request.sink.warn(`[mem] node="${request.label}" space report failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
630
607
|
}
|
|
631
|
-
if (!heapSnapshotAuthorised(deps.env)) {
|
|
632
|
-
request.sink.info(`[mem] node="${request.label}" heap snapshot NOT taken — it is an admin mutation (a multi-GB write and a stop-the-world walk of the heap). The per-space breakdown above is the free half and needs no authorisation. Set ${RUNNER_HEAP_SNAPSHOT_ENV}=on for this runner and signal again to take one.`);
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
try {
|
|
636
|
-
deps.writeSnapshot(request.snapshotPath);
|
|
637
|
-
request.sink.info(`[mem] node="${request.label}" heap snapshot written -> ${request.snapshotPath}`);
|
|
638
|
-
} catch (error) {
|
|
639
|
-
request.sink.warn(`[mem] node="${request.label}" snapshot failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
640
|
-
}
|
|
641
608
|
}
|
|
642
609
|
//#endregion
|
|
643
610
|
//#region src/kernel/heap-watch.ts
|
|
@@ -10151,12 +10118,6 @@ Object.defineProperty(exports, "RSS_BUDGET_RELEASE_RATIO", {
|
|
|
10151
10118
|
return RSS_BUDGET_RELEASE_RATIO;
|
|
10152
10119
|
}
|
|
10153
10120
|
});
|
|
10154
|
-
Object.defineProperty(exports, "RUNNER_HEAP_SNAPSHOT_ENV", {
|
|
10155
|
-
enumerable: true,
|
|
10156
|
-
get: function() {
|
|
10157
|
-
return RUNNER_HEAP_SNAPSHOT_ENV;
|
|
10158
|
-
}
|
|
10159
|
-
});
|
|
10160
10121
|
Object.defineProperty(exports, "RUNNER_HEAP_WATCH_INTERVAL_MS", {
|
|
10161
10122
|
enumerable: true,
|
|
10162
10123
|
get: function() {
|
|
@@ -10523,12 +10484,6 @@ Object.defineProperty(exports, "getWorkerNativeCapSnapshot", {
|
|
|
10523
10484
|
return getWorkerNativeCapSnapshot;
|
|
10524
10485
|
}
|
|
10525
10486
|
});
|
|
10526
|
-
Object.defineProperty(exports, "heapSnapshotAuthorised", {
|
|
10527
|
-
enumerable: true,
|
|
10528
|
-
get: function() {
|
|
10529
|
-
return heapSnapshotAuthorised;
|
|
10530
|
-
}
|
|
10531
|
-
});
|
|
10532
10487
|
Object.defineProperty(exports, "heapSpaceField", {
|
|
10533
10488
|
enumerable: true,
|
|
10534
10489
|
get: function() {
|