diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-05-28 16:11:46 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-05-28 16:11:46 +0300 |
| commit | baf8c94b2e643e41a4319f0ca55e9c66b64970b0 (patch) | |
| tree | d68c4b517214271ce83479255391bb191ec79a38 /web/service | |
| parent | adcfccbe4550ebca477e8fd9a6ef00dd10002809 (diff) | |
new - vCPUs
Diffstat (limited to 'web/service')
| -rw-r--r-- | web/service/server.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/web/service/server.go b/web/service/server.go index b2dfd22f..ce7f1994 100644 --- a/web/service/server.go +++ b/web/service/server.go @@ -43,6 +43,7 @@ type Status struct { T time.Time `json:"-"` Cpu float64 `json:"cpu"` CpuCores int `json:"cpuCores"` + LogicalPro int `json:"logicalPro"` CpuSpeedMhz float64 `json:"cpuSpeedMhz"` Mem struct { Current uint64 `json:"current"` @@ -131,6 +132,13 @@ func (s *ServerService) GetStatus(lastStatus *Status) *Status { logger.Warning("get cpu cores count failed:", err) } + status.LogicalPro = runtime.NumCPU() + if p != nil && p.IsRunning() { + status.AppStats.Uptime = p.GetUptime() + } else { + status.AppStats.Uptime = 0 + } + cpuInfos, err := cpu.Info() if err != nil { logger.Warning("get cpu info failed:", err) |
