Skip to content

Commit c0796dc

Browse files
authored
fix: Fix the issue of monitoring fields not being generated properly (#11153)
1 parent ff97475 commit c0796dc

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

agent/app/model/cronjob.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ type Cronjob struct {
4343
EntryIDs string `json:"entryIDs"`
4444
Records []JobRecords `json:"records"`
4545
Secret string `json:"secret"`
46+
47+
Config string `json:"config"`
4648
}
4749

4850
type JobRecords struct {

agent/app/model/monitor.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ package model
22

33
type MonitorBase struct {
44
BaseModel
5-
Cpu float64 `json:"cpu"`
5+
Cpu float64 `json:"cpu"`
6+
TopCPU string `json:"topCPU"`
7+
TopCPUItems interface{} `gorm:"-" json:"topCPUItems"`
8+
9+
Memory float64 `json:"memory"`
10+
TopMem string `json:"topMem"`
11+
TopMemItems interface{} `gorm:"-" json:"topMemItems"`
612

713
LoadUsage float64 `json:"loadUsage"`
814
CpuLoad1 float64 `json:"cpuLoad1"`
915
CpuLoad5 float64 `json:"cpuLoad5"`
1016
CpuLoad15 float64 `json:"cpuLoad15"`
11-
12-
Memory float64 `json:"memory"`
1317
}
1418

1519
type MonitorIO struct {

agent/init/migration/migrations/init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,14 +661,14 @@ var UpdateMonitorInterval = &gormigrate.Migration{
661661
}
662662

663663
var AddMonitorProcess = &gormigrate.Migration{
664-
ID: "20251030-add-monitor-process",
664+
ID: "20251202-add-monitor-process",
665665
Migrate: func(tx *gorm.DB) error {
666666
return global.MonitorDB.AutoMigrate(&model.MonitorBase{})
667667
},
668668
}
669669

670670
var UpdateCronJob = &gormigrate.Migration{
671-
ID: "20251105-update-cronjob",
671+
ID: "20251202-update-cronjob",
672672
Migrate: func(tx *gorm.DB) error {
673673
return tx.AutoMigrate(&model.Cronjob{})
674674
},

0 commit comments

Comments
 (0)