Go FMT run on entire project
This commit is contained in:
parent
7c7d80b557
commit
86790133e1
4 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
||||||
package pcp
|
package pcp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bitbucket.org/bingcloud/electron/rapl"
|
||||||
"bufio"
|
"bufio"
|
||||||
"container/ring"
|
"container/ring"
|
||||||
"log"
|
"log"
|
||||||
|
@ -12,7 +13,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
"bitbucket.org/bingcloud/electron/rapl"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var RAPLUnits = math.Pow(2, -32)
|
var RAPLUnits = math.Pow(2, -32)
|
||||||
|
|
|
@ -2,7 +2,7 @@ package pcp
|
||||||
|
|
||||||
type Victim struct {
|
type Victim struct {
|
||||||
Watts float64
|
Watts float64
|
||||||
Host string
|
Host string
|
||||||
}
|
}
|
||||||
|
|
||||||
type VictimSorter []Victim
|
type VictimSorter []Victim
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package rapl
|
package rapl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"golang.org/x/crypto/ssh"
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
"golang.org/x/crypto/ssh"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Cap(host, username string, percentage int) (error) {
|
func Cap(host, username string, percentage int) error {
|
||||||
|
|
||||||
if percentage > 100 || percentage < 0 {
|
if percentage > 100 || percentage < 0 {
|
||||||
return errors.New("Percentage is out of range")
|
return errors.New("Percentage is out of range")
|
||||||
|
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"github.com/mesos/mesos-go/mesosutil"
|
"github.com/mesos/mesos-go/mesosutil"
|
||||||
sched "github.com/mesos/mesos-go/scheduler"
|
sched "github.com/mesos/mesos-go/scheduler"
|
||||||
"log"
|
"log"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"sort"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Decides if to take an offer or not
|
// Decides if to take an offer or not
|
||||||
|
@ -177,7 +177,7 @@ func (s *FirstFitSortedWatts) ResourceOffers(driver sched.SchedulerDriver, offer
|
||||||
|
|
||||||
if *task.Instances <= 0 {
|
if *task.Instances <= 0 {
|
||||||
// All instances of task have been scheduled, remove it
|
// All instances of task have been scheduled, remove it
|
||||||
s.tasks= append(s.tasks[:i], s.tasks[i+1:]...)
|
s.tasks = append(s.tasks[:i], s.tasks[i+1:]...)
|
||||||
|
|
||||||
if len(s.tasks) <= 0 {
|
if len(s.tasks) <= 0 {
|
||||||
log.Println("Done scheduling all tasks")
|
log.Println("Done scheduling all tasks")
|
||||||
|
|
Reference in a new issue