From 236be222cdcedc360afd841b76a0a79f19b852b6 Mon Sep 17 00:00:00 2001 From: Pradyumna Kaushik Date: Thu, 15 Dec 2016 14:39:06 -0500 Subject: [PATCH] Logging of capping happens only when there is no error with rapl.Cap. --- schedulers/pistoncapper.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/schedulers/pistoncapper.go b/schedulers/pistoncapper.go index 60f2a56..eea64cf 100644 --- a/schedulers/pistoncapper.go +++ b/schedulers/pistoncapper.go @@ -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 } }