renamed constants.CapMargin to constants.Tolerance for better semantics

This commit is contained in:
Pradyumna Kaushik 2017-02-10 20:53:18 -05:00
parent ad925dfc8f
commit ec78480067
4 changed files with 10 additions and 10 deletions

View file

@ -23,7 +23,7 @@ type taskWrapper struct {
}
func (tw taskWrapper) Val() float64 {
return tw.task.Watts * constants.CapMargin
return tw.task.Watts * constants.Tolerance
}
func (tw taskWrapper) ID() string {
@ -121,7 +121,7 @@ func (capper ClusterwideCapper) CleverRecap(totalPower map[string]float64,
// Not considering this task for the computation of totalAllocatedPower and totalRunningTasks
continue
}
wattsUsages[host] = append(wattsUsages[host], float64(task.Watts)*constants.CapMargin)
wattsUsages[host] = append(wattsUsages[host], float64(task.Watts)*constants.Tolerance)
}
}
@ -202,7 +202,7 @@ func (capper ClusterwideCapper) NaiveRecap(totalPower map[string]float64,
// Not considering this task for the computation of totalAllocatedPower and totalRunningTasks
continue
}
totalAllocatedPower += (float64(task.Watts) * constants.CapMargin)
totalAllocatedPower += (float64(task.Watts) * constants.Tolerance)
totalRunningTasks++
}
}