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:
parent
1386049d30
commit
cf3d83e712
5 changed files with 245 additions and 186 deletions
20
pcp/victim.go
Normal file
20
pcp/victim.go
Normal 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]
|
||||
}
|
Reference in a new issue