Logging of capping happens only when there is no error with rapl.Cap.

This commit is contained in:
Pradyumna Kaushik 2016-12-15 14:39:06 -05:00 committed by Renan DelValle
parent d9357f59e7
commit 236be222cd

View file

@ -165,15 +165,17 @@ func (s *PistonCapper) startCapping() {
if prevRoundedCap != roundedCapValue {
if err := rapl.Cap(host, "rapl", roundedCapValue); err != nil {
log.Println(err)
} else {
log.Printf("Capped [%s] at %d", host, int(math.Floor(capValue + 0.5)))
}
log.Printf("Capped [%s] at %d", host, int(math.Floor(capValue + 0.5)))
previousRoundedCapValues[host] = roundedCapValue
}
} else {
if err := rapl.Cap(host, "rapl", roundedCapValue); err != nil {
log.Println(err)
} else {
log.Printf("Capped [%s] at %d", host, int(math.Floor(capValue + 0.5)))
}
log.Printf("Capped [%s] at %d", host, int(math.Floor(capValue + 0.5)))
previousRoundedCapValues[host] = roundedCapValue
}
}