mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 05:19:05 +01:00
correct input for check
This commit is contained in:
parent
00ddc462d2
commit
93d5a0e532
@ -76,17 +76,18 @@ func RegisterFootprintWorker() {
|
|||||||
Statistics: make(map[string]schema.JobStatistics),
|
Statistics: make(map[string]schema.JobStatistics),
|
||||||
}
|
}
|
||||||
|
|
||||||
for metric := range jobStats { // Metric, Hostname:Stats
|
for _, metric := range allMetrics {
|
||||||
avg, min, max := 0.0, 0.0, 0.0 // math.MaxFloat32, -math.MaxFloat32
|
avg, min, max := 0.0, 0.0, 0.0 // math.MaxFloat32, -math.MaxFloat32
|
||||||
|
data, ok := jobStats[metric] // Metric:[Hostname:Stats]
|
||||||
data, ok := jobStats[metric]
|
|
||||||
if ok {
|
if ok {
|
||||||
for hostname := range data {
|
for _, res := range job.Resources {
|
||||||
hostStats, ok := data[hostname]
|
hostStats, ok := data[res.Hostname]
|
||||||
if ok {
|
if ok {
|
||||||
avg += hostStats.Avg
|
avg += hostStats.Avg
|
||||||
min = math.Min(min, hostStats.Min)
|
min = math.Min(min, hostStats.Min)
|
||||||
max = math.Max(max, hostStats.Max)
|
max = math.Max(max, hostStats.Max)
|
||||||
|
} else {
|
||||||
|
log.Debugf("no stats data return for host %s in job %d, metric %s", res.Hostname, job.JobID, metric)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user