add disk_util for target table
This commit is contained in:
parent
b1b2c7d6b0
commit
23d7e5a7de
|
@ -179,4 +179,5 @@ Timeout = 3000
|
||||||
[TargetMetrics]
|
[TargetMetrics]
|
||||||
TargetUp = '''max(max_over_time(target_up{ident=~"(%s)"}[%dm])) by (ident)'''
|
TargetUp = '''max(max_over_time(target_up{ident=~"(%s)"}[%dm])) by (ident)'''
|
||||||
LoadPerCore = '''max(max_over_time(system_load_norm_1{ident=~"(%s)"}[%dm])) by (ident)'''
|
LoadPerCore = '''max(max_over_time(system_load_norm_1{ident=~"(%s)"}[%dm])) by (ident)'''
|
||||||
MemUtil = '''100-max(max_over_time(mem_available_percent{ident=~"(%s)"}[%dm])) by (ident)'''
|
MemUtil = '''100-max(max_over_time(mem_available_percent{ident=~"(%s)"}[%dm])) by (ident)'''
|
||||||
|
DiskUtil = '''max(max_over_time(disk_used_percent{ident=~"(%s)", path="/"}[%dm])) by (ident)'''
|
|
@ -207,4 +207,4 @@ Timeout = 3000
|
||||||
TargetUp = '''max(max_over_time(target_up{ident=~"(%s)"}[%dm])) by (ident)'''
|
TargetUp = '''max(max_over_time(target_up{ident=~"(%s)"}[%dm])) by (ident)'''
|
||||||
LoadPerCore = '''max(max_over_time(system_load_norm_1{ident=~"(%s)"}[%dm])) by (ident)'''
|
LoadPerCore = '''max(max_over_time(system_load_norm_1{ident=~"(%s)"}[%dm])) by (ident)'''
|
||||||
MemUtil = '''100-max(max_over_time(mem_available_percent{ident=~"(%s)"}[%dm])) by (ident)'''
|
MemUtil = '''100-max(max_over_time(mem_available_percent{ident=~"(%s)"}[%dm])) by (ident)'''
|
||||||
DiskUsedPercent = '''max(max_over_time(disk_used_percent{ident=~"(%s)", path="/"}[%dm])) by (ident)'''
|
DiskUtil = '''max(max_over_time(disk_used_percent{ident=~"(%s)", path="/"}[%dm])) by (ident)'''
|
|
@ -21,10 +21,10 @@ type Target struct {
|
||||||
TagsMap map[string]string `json:"-" gorm:"-"` // internal use, append tags to series
|
TagsMap map[string]string `json:"-" gorm:"-"` // internal use, append tags to series
|
||||||
UpdateAt int64 `json:"update_at"`
|
UpdateAt int64 `json:"update_at"`
|
||||||
|
|
||||||
LoadPerCore float64 `json:"load_per_core" gorm:"-"`
|
TargetUp float64 `json:"target_up" gorm:"-"`
|
||||||
MemUtil float64 `json:"mem_util" gorm:"-"`
|
LoadPerCore float64 `json:"load_per_core" gorm:"-"`
|
||||||
TargetUp float64 `json:"target_up" gorm:"-"`
|
MemUtil float64 `json:"mem_util" gorm:"-"`
|
||||||
DiskUsedPercent float64 `json:"disk_used_percent" gorm:"-"`
|
DiskUtil float64 `json:"disk_util" gorm:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Target) TableName() string {
|
func (t *Target) TableName() string {
|
||||||
|
|
|
@ -80,8 +80,8 @@ func targetGets(c *gin.Context) {
|
||||||
t.MemUtil = values[ident]
|
t.MemUtil = values[ident]
|
||||||
case "TargetUp":
|
case "TargetUp":
|
||||||
t.TargetUp = values[ident]
|
t.TargetUp = values[ident]
|
||||||
case "DiskUsedPercent":
|
case "DiskUtil":
|
||||||
t.DiskUsedPercent = values[ident]
|
t.DiskUtil = values[ident]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue