monitor_resource
| 屬性 | 類型 | 描述 |
|---|---|---|
| id | bigint | 主鍵 |
| type | varchar(20) | LOCAL或 AWS 或ALIYUN |
| cpu_total | int | cpu總數(shù) |
| cpu_reserve | int | cpu保留數(shù) |
| cpu_used | int | cpu已使用數(shù) |
| memory_total | int | 內(nèi)存總數(shù) |
| memory_used | int | 內(nèi)存已使用數(shù) |
node_resource
| 屬性 | 類型 | 描述 |
|---|---|---|
| id | bigint | 主鍵 |
| monitor_resource | bigint | 來源cluster id |
| cpu_total | int | cpu總數(shù) |
| cpu_reserve | int | cpu保留數(shù) |
| cpu_used | int | cpu已使用數(shù) |
| memory_total | int | 內(nèi)存總數(shù) |
| memory_used | int | 內(nèi)存已使用數(shù) |
查詢資源 **/api/v1/monitor/{type}, GET
如 type 為 "LOCAL"
{
"type": "LOCAL",
"cpuTotal": 32,
"cpuScheduler":30,
"cpuAlloc":20,
"cpuFree":10,
"memoryTotal":100,
"memoryUsed":20,
"memoryFree":80,
"memoryPercentage":10,
"memoryFreePercentage":90
}
查看類型為 type下 所有node 資源使用情況
/api/v1/monitor/{type}/nodes GET
[
{
"hostname": "hahaha",
"memoryTotal":100,
"cpuTotal":20
},
{
"hostname":"xixixi",
"memoryTotal":100,
"cpuTotal":20
}
]
查詢資源 /api/v1/monitor/{type}/cluster/cpu/range?startTime=123&endTime=456&step=15s
如果不傳step,默認(rèn)為 10S, GET
[
{
"currentTime":123(long型的時間戳),
"cpuPercentage": 20
},
{
"currentTime":138(long型的時間戳),
"cpuPercentage": 30
}
……
]
查看node hostName為"computer"的cluster node的 資源使用情況
/api/v1/monitor/{type}/node/computer GET
{
"hostname": "computer",
"cpuTotal": 32,
"cpuScheduler":30,
"cpuAlloc":20,
"cpuFree":10,
"memoryTotal":100,
"memoryUsed":20,
"memoryFree":80,
"memoryPercentage":10,
"memoryFreePercentage":90
}
job為slurm_job_running或者slurm_job_pending
查詢job /api/v1/monitor/{type}/job/{jobProperty}
[
{
"state":"slurm_job_pending",
"number":"200"
},
{
"state":"slurm_job_running",
"number":"10"
}
]
查詢資源 /api/v1/monitor/{type}/{hostName}/cpu/range?startTime=123&endTime=456&step=15s
如果不傳step,默認(rèn)為 10S, GET
[
{
"currentTime":123(long型的時間戳),
"cpuPercentage": 20
},
{
"currentTime":138(long型的時間戳),
"cpuPercentage": 30
}
……
]