@abtnode/core 1.17.7-beta-20251227-001958-ea2ba3f5 → 1.17.7-beta-20251229-085620-84f09930
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/lib/blocklet/manager/disk.js +73 -32
- package/lib/blocklet/manager/ensure-blocklet-running.js +1 -1
- package/lib/blocklet/manager/helper/blue-green-start-blocklet.js +1 -1
- package/lib/blocklet/manager/helper/install-application-from-general.js +2 -3
- package/lib/blocklet/manager/helper/install-component-from-url.js +7 -4
- package/lib/blocklet/migration-dist/migration.cjs +5 -4
- package/lib/blocklet/passport/index.js +10 -3
- package/lib/blocklet/project/index.js +7 -2
- package/lib/blocklet/security/index.js +2 -2
- package/lib/cert.js +6 -3
- package/lib/event/index.js +98 -87
- package/lib/event/util.js +7 -13
- package/lib/index.js +15 -26
- package/lib/migrations/1.5.0-site.js +3 -7
- package/lib/migrations/1.5.15-site.js +3 -7
- package/lib/monitor/blocklet-runtime-monitor.js +37 -5
- package/lib/monitor/node-runtime-monitor.js +4 -4
- package/lib/router/helper.js +525 -452
- package/lib/router/index.js +280 -104
- package/lib/router/manager.js +14 -28
- package/lib/states/blocklet-child.js +93 -1
- package/lib/states/blocklet-extras.js +1 -1
- package/lib/states/blocklet.js +429 -197
- package/lib/states/node.js +0 -10
- package/lib/states/site.js +87 -4
- package/lib/team/manager.js +2 -21
- package/lib/util/blocklet.js +39 -19
- package/lib/util/get-accessible-external-node-ip.js +21 -6
- package/lib/util/index.js +3 -3
- package/lib/util/ip.js +15 -1
- package/lib/util/launcher.js +11 -11
- package/lib/util/ready.js +2 -9
- package/lib/util/reset-node.js +6 -5
- package/lib/validators/router.js +0 -3
- package/lib/webhook/sender/api/index.js +5 -0
- package/package.json +23 -25
- package/lib/migrations/1.0.36-snapshot.js +0 -10
- package/lib/migrations/1.1.9-snapshot.js +0 -7
- package/lib/states/routing-snapshot.js +0 -146
|
@@ -169,14 +169,14 @@ class NodeRuntimeMonitor extends EventEmitter {
|
|
|
169
169
|
try {
|
|
170
170
|
const { cpu, mem, disks } = this.data.realtime;
|
|
171
171
|
// 计算每个 CPU 的占用率:load字段为百分比,除以 100 得到 0 到 1 的值
|
|
172
|
-
const cpuUtilizations = cpu.cpus
|
|
172
|
+
const cpuUtilizations = cpu.cpus?.filter((v) => v.load > 0).map((v) => v.load / 100) || [0];
|
|
173
|
+
|
|
174
|
+
// 计算每个硬盘占用率:used / total
|
|
175
|
+
const diskUtilizations = disks?.filter((v) => v.used > 0).map((v) => v.used / v.total) || [0];
|
|
173
176
|
|
|
174
177
|
// 计算内存占用率:used / total
|
|
175
178
|
const memoryUtilization = mem.total > 0 && mem.available > 0 ? (mem.total - mem.available) / mem.total : 0;
|
|
176
179
|
|
|
177
|
-
// 计算每个硬盘占用率:used / total
|
|
178
|
-
const diskUtilizations = disks.filter((v) => v.used > 0).map((v) => v.used / v.total);
|
|
179
|
-
|
|
180
180
|
// 返回包含所需值的对象
|
|
181
181
|
return {
|
|
182
182
|
cpus: cpuUtilizations,
|