mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
get server status from internal server
This commit is contained in:
parent
b5396530fd
commit
5971e5bb2c
@ -189,30 +189,9 @@ class StreamingServer {
|
|||||||
"/status": {
|
"/status": {
|
||||||
method: "get",
|
method: "get",
|
||||||
fn: async (req, res) => {
|
fn: async (req, res) => {
|
||||||
const cpuPercentageUsage = await cpu.percentageUsage()
|
const serverStatus = await this.IMediaServer.getServerStatus()
|
||||||
|
|
||||||
return res.json({
|
return res.json(serverStatus)
|
||||||
os: {
|
|
||||||
arch: os.arch(),
|
|
||||||
platform: os.platform(),
|
|
||||||
release: os.release(),
|
|
||||||
},
|
|
||||||
cpu: {
|
|
||||||
num: os.cpus().length,
|
|
||||||
load: cpuPercentageUsage,
|
|
||||||
model: os.cpus()[0].model,
|
|
||||||
speed: os.cpus()[0].speed,
|
|
||||||
},
|
|
||||||
mem: {
|
|
||||||
totle: os.totalmem(),
|
|
||||||
free: os.freemem()
|
|
||||||
},
|
|
||||||
nodejs: {
|
|
||||||
uptime: Math.floor(process.uptime()),
|
|
||||||
version: process.version,
|
|
||||||
mem: process.memoryUsage()
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/streams": {
|
"/streams": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user