mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 07:33:12 +09:00
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:
1 parent
4e36fa1b4e
commit
de47989527
6 files changed
+63
-3
No files matched your search
@@ -211,6 +211,11 @@ export class SystemInfo {
|
||||
* "controller" if these metrics are for the controller.
|
||||
*/
|
||||
public id: number | "controller",
|
||||
public hostname: string,
|
||||
public node: string,
|
||||
public kernel: string,
|
||||
public machine: string,
|
||||
public cpuModel: string,
|
||||
public coreRatios: number[],
|
||||
public memoryCapacity: number,
|
||||
public memoryAvailable: number,
|
||||
@@ -223,6 +228,11 @@ export class SystemInfo {
|
||||
|
||||
static jsonSchema = Type.Object({
|
||||
"id": Type.Union([Type.Number(), Type.Literal("controller")]),
|
||||
"hostname": Type.String(),
|
||||
"node": Type.String(),
|
||||
"kernel": Type.String(),
|
||||
"machine": Type.String(),
|
||||
"cpuModel": Type.String(),
|
||||
"coreRatios": Type.Array(Type.Number()),
|
||||
"memoryCapacity": Type.Number(),
|
||||
"memoryAvailable": Type.Number(),
|
||||
@@ -235,6 +245,11 @@ export class SystemInfo {
|
||||
static fromJSON(json: Static<typeof this.jsonSchema>) {
|
||||
return new this(
|
||||
json.id,
|
||||
json.hostname,
|
||||
json.node,
|
||||
json.kernel,
|
||||
json.machine,
|
||||
json.cpuModel,
|
||||
json.coreRatios,
|
||||
json.memoryCapacity,
|
||||
json.memoryAvailable,
|
||||
|
||||
Reference in new issue
Block a user