Add system info to SystemInfo

Provide the kernel, machine, CPU Model, hostname, and Node.js version
fields to SystemInfo and display them in the Web UI.  These were added
as metrics exposed to prometheus in b46efeb.
This commit is contained in:
Hornwitser committed 2024-01-16 21:27:02 +01:00
1 parent 4e36fa1b4e
commit de47989527
6 files changed
+63 -3

No files matched your search

+15 -1
View File
@@ -8,7 +8,21 @@ const { SystemInfo } = lib;
describe("lib/data/ModPack", function() {
describe("class SystemInfo", function() {
it("correctly calculates derived metrics", function() {
const system = new SystemInfo("controller", [0.5, 0.25, 0, 1], 1024, 768, 2048, 512, 0, false);
const system = new SystemInfo(
"controller",
"server",
"v18.0.0",
"Linux",
"x86_64",
"x86 CPU",
[0.5, 0.25, 0, 1],
1024,
768,
2048,
512,
0,
false
);
assert.equal(system.cpuCapacity, 4);
assert.equal(system.cpuUsed, 1.75);
assert.equal(system.cpuAvailable, 2.25);