Skip to main content

client.system

client.system provides access to system-level functionality needed to build tooling around a running Hivekit Cluster. This is targeted to Hivekit's On-Premise offering for enterprise customers and won't have much use for Hivekit Cloud users.

client.system.authenticateAdmin(password)

  • password a string configured in conf.yml as admin password.
  • returns Promise that resolves if successful or rejects with a reason

Authenticates the client as an Admin via HTTP request. If the request succeeds, a cookie with a session token will be set. Returns a promise that resolves if authentication was successful or rejects with a reason if not.

client.system.authenticateAdmin(password).then(() => {
document.location.reload();
}).catch(rejectionReason => {
alert( rejectionReason );
});

client.system.getServerStats()

Returns a promise that resolves to a server stats object, describing the state of the server you're currently connected to as well as the cluster at large.

  • returns Promise that resolves with server stats
const serverStats = await client.system.getServerStats();
// server stats for a cluster with two proxies and two realm-instruction-processors would e.g. look like:
{
"realmCount": 0,
"objectCount": 0,
"areaCount": 0,
"instructionCount": 0,
"subscriptionCount": 0,
"allocBytes": 26072256,
"totalBytes": 43057152,
"usedBytes": "0.61%",
"version": "0.12.2",
"buildDate": "Tue Mar 28 19:20:22 UTC 2023",
"connectionCounts": {
"htp": 0,
"tcp": 0,
"wso": 310
},
"uptime": "36h40m52.667644603s",
"clusterState": {
"123.456.79.90:8101": {
"remoteUrl": "123.456.79.90:8101",
"realmIds": null,
"lastUpdated": "2023-03-30T08:22:58.887888Z",
"utilisationScore": 0,
"data": {
"serverStats": {
"allocBytes": 8449328,
"areaCount": 0,
"buildDate": "Tue Mar 28 19:20:22 UTC 2023",
"clusterState": null,
"connectionCounts": {
"htp": 0
},
"instructionCount": 2,
"objectCount": 270,
"realmCount": 1,
"subscriptionCount": 140,
"totalBytes": 18743296,
"uptime": "36h48m40.917639961s",
"usedBytes": "0.45%",
"version": "0.12.2"
}
},
"role": "realm-instruction-processor"
},
"123.456.79.90:8101": {
"remoteUrl": "123.456.79.90:8101",
"realmIds": null,
"lastUpdated": "2023-03-30T08:22:55.924705Z",
"utilisationScore": 0,
"data": {
"clusterConnections": {
"123.456.79.90:8101": 0,
"123.456.79.90:8101": 0
},
"serverStats": {
"allocBytes": 18191312,
"areaCount": 0,
"buildDate": "Tue Mar 28 19:20:22 UTC 2023",
"clusterState": null,
"connectionCounts": {
"htp": 0,
"tcp": 0,
"wso": 301
},
"instructionCount": 0,
"objectCount": 0,
"realmCount": 0,
"subscriptionCount": 0,
"totalBytes": 44466176,
"uptime": "36h48m34.646649784s",
"usedBytes": "0.41%",
"version": "0.12.2"
}
},
"role": "proxy"
},
"123.456.79.90:8101": {
"remoteUrl": "123.456.79.90:8101",
"realmIds": null,
"lastUpdated": "2023-03-30T08:22:54.554889Z",
"utilisationScore": 0,
"data": {
"clusterConnections": {
"123.456.79.90:8101": 0,
"123.456.79.90:8101": 0
},
"serverStats": {
"allocBytes": 25091416,
"areaCount": 0,
"buildDate": "Tue Mar 28 19:20:22 UTC 2023",
"clusterState": null,
"connectionCounts": {
"htp": 0,
"tcp": 0,
"wso": 309
},
"instructionCount": 0,
"objectCount": 0,
"realmCount": 0,
"subscriptionCount": 0,
"totalBytes": 43089920,
"uptime": "36h40m46.179557123s",
"usedBytes": "0.58%",
"version": "0.12.2"
}
},
"role": "proxy"
},
"123.456.79.90:8101": {
"remoteUrl": "123.456.79.90:8101",
"realmIds": null,
"lastUpdated": "2023-03-30T08:22:56.955143Z",
"utilisationScore": 0,
"data": {
"serverStats": {
"allocBytes": 2170336,
"areaCount": 0,
"buildDate": "Tue Mar 28 19:20:22 UTC 2023",
"clusterState": null,
"connectionCounts": {
"htp": 0
},
"instructionCount": 0,
"objectCount": 0,
"realmCount": 0,
"subscriptionCount": 0,
"totalBytes": 7897088,
"uptime": "1h1m2.956047867s",
"usedBytes": "0.27%",
"version": "0.12.2"
}
},
"role": "realm-instruction-processor"
}
}
}