Finished integrating dynamic capping policy that uses a high and a low threshold to start capping and uncapping node via an ssh commands that triggers a python script. Commit has sensitive data, scrub before releasing to public.

This commit is contained in:
Renan DelValle 2016-10-18 17:38:49 -04:00
parent 1386049d30
commit cf3d83e712
5 changed files with 245 additions and 186 deletions

20
pcp/victim.go Normal file
View file

@ -0,0 +1,20 @@
package pcp
type Victim struct {
Watts float64
Host string
}
type VictimSorter []Victim
func (slice VictimSorter) Len() int {
return len(slice)
}
func (slice VictimSorter) Less(i, j int) bool {
return slice[i].Watts >= slice[j].Watts
}
func (slice VictimSorter) Swap(i, j int) {
slice[i], slice[j] = slice[j], slice[i]
}