Commit a9dd8628 authored by Your Name's avatar Your Name

update to monitor-smi:v.0.0.5

parent a6fdb093
...@@ -18,6 +18,8 @@ func CpuSmi() (Cpu, error) { ...@@ -18,6 +18,8 @@ func CpuSmi() (Cpu, error) {
cores := 0 cores := 0
physicalMap := make(map[string]bool)
model := "" model := ""
for _, info := range infos { for _, info := range infos {
...@@ -29,6 +31,8 @@ func CpuSmi() (Cpu, error) { ...@@ -29,6 +31,8 @@ func CpuSmi() (Cpu, error) {
if len(model) == 0 { if len(model) == 0 {
model = info.ModelName model = info.ModelName
} }
physicalMap[info.PhysicalID] = true
} }
idx := strings.IndexAny(model, "@") idx := strings.IndexAny(model, "@")
...@@ -53,6 +57,7 @@ func CpuSmi() (Cpu, error) { ...@@ -53,6 +57,7 @@ func CpuSmi() (Cpu, error) {
return Cpu{ return Cpu{
Model: model, Model: model,
Number: int64(len(physicalMap)),
Cores: int64(c), Cores: int64(c),
Threads: int64(len(infos)), Threads: int64(len(infos)),
Usage: percentAsInt, Usage: percentAsInt,
......
...@@ -2,7 +2,7 @@ version: "3.9" ...@@ -2,7 +2,7 @@ version: "3.9"
services: services:
monitorSmi: monitorSmi:
image: docker.ai.17xuexi.com/monitorapi/monitor-smi:v.0.0.4 image: docker.ai.17xuexi.com/monitorapi/monitor-smi:v.0.0.5
network_mode: host network_mode: host
volumes: volumes:
- /proc:/host/proc:ro - /proc:/host/proc:ro
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment