mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #2452 from tb365/bugfix/tb-host-metric-fix-0821
add update vm name method
This commit is contained in:
@@ -177,6 +177,7 @@ func (s *SGuestMonitorCollector) GetGuests() map[string]*SGuestMonitor {
|
||||
gm, ok := s.monitors[guestId]
|
||||
if ok && gm.Pid == pid {
|
||||
delete(s.monitors, guestId)
|
||||
gm.UpdateVmName(guestName)
|
||||
gm.UpdateNicsDesc(nics)
|
||||
gm.UpdateCpuCount(int(vcpuCount))
|
||||
} else {
|
||||
@@ -401,6 +402,10 @@ func NewGuestMonitor(name, id string, pid int, nics []jsonutils.JSONObject, cpuC
|
||||
return &SGuestMonitor{name, id, pid, nics, cpuCount, ip, proc}, nil
|
||||
}
|
||||
|
||||
func (m *SGuestMonitor) UpdateVmName(name string) {
|
||||
m.Name = name
|
||||
}
|
||||
|
||||
func (m *SGuestMonitor) UpdateNicsDesc(nics []jsonutils.JSONObject) {
|
||||
m.Nics = nics
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
package notify // import "yunion.io/x/onecloud/pkg/notify"
|
||||
@@ -0,0 +1 @@
|
||||
package models // import "yunion.io/x/onecloud/pkg/notify/models"
|
||||
@@ -0,0 +1 @@
|
||||
package options // import "yunion.io/x/onecloud/pkg/notify/options"
|
||||
@@ -0,0 +1 @@
|
||||
package utils // import "yunion.io/x/onecloud/pkg/notify/utils"
|
||||
@@ -0,0 +1 @@
|
||||
package bitmap // import "yunion.io/x/onecloud/pkg/util/bitmap"
|
||||
Reference in New Issue
Block a user