Code formatting
This commit is contained in:
parent
ef8bd6ac1f
commit
4d15e59d4c
41 changed files with 472 additions and 475 deletions
|
@ -25,9 +25,9 @@ import (
|
|||
|
||||
"github.com/mash/gokmeans"
|
||||
"github.com/montanaflynn/stats"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Information about a cluster of tasks.
|
||||
|
|
|
@ -3,9 +3,9 @@ package elektronLogging
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
"github.com/fatih/color"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type ElektronFormatter struct {
|
||||
|
@ -47,7 +47,6 @@ func (f ElektronFormatter) Format(entry *log.Entry) ([]byte, error) {
|
|||
strings.Join([]string{key, fmt.Sprintf("%s", value)}, "="))
|
||||
}
|
||||
|
||||
|
||||
b.WriteString(message)
|
||||
b.WriteString(strings.Join(formattedFields, ", "))
|
||||
b.WriteByte('\n')
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package elektronLogging
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
)
|
||||
|
||||
type ClsfnTaskDistOverheadLogger struct {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package elektronLogging
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
)
|
||||
|
||||
type ConsoleLogger struct {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package elektronLogging
|
||||
|
||||
import (
|
||||
logrus "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
logrus "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var logDir string
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package elektronLogging
|
||||
|
||||
import (
|
||||
"time"
|
||||
"fmt"
|
||||
"strconv"
|
||||
. "github.com/spdfg/elektron/elektronLogging/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
. "github.com/spdfg/elektron/elektronLogging/types"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
var config LoggerConfig
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package elektronLogging
|
||||
|
||||
import (
|
||||
"gopkg.in/yaml.v2"
|
||||
"io/ioutil"
|
||||
log "github.com/sirupsen/logrus"
|
||||
elekEnv "github.com/spdfg/elektron/environment"
|
||||
"gopkg.in/yaml.v2"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
type LoggerConfig struct {
|
||||
|
||||
SchedTraceConfig struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
FilenameExtension string `yaml:"filenameExtension"`
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package elektronLogging
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
)
|
||||
|
||||
type PcpLogger struct {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package elektronLogging
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
)
|
||||
|
||||
type SchedPolicySwitchLogger struct {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package elektronLogging
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
)
|
||||
|
||||
type SchedTraceLogger struct {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package elektronLogging
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
)
|
||||
|
||||
type SchedWindowLogger struct {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package elektronLogging
|
||||
|
||||
|
||||
const (
|
||||
ERROR = iota
|
||||
WARNING = iota
|
||||
|
@ -13,4 +12,3 @@ const (
|
|||
SCHED_WINDOW = iota
|
||||
CLSFN_TASKDIST_OVERHEAD = iota
|
||||
)
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
|
||||
|
|
|
@ -29,11 +29,11 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/spdfg/elektron/pcp"
|
||||
"github.com/spdfg/elektron/rapl"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/pcp"
|
||||
"github.com/spdfg/elektron/rapl"
|
||||
)
|
||||
|
||||
func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThreshold, loThreshold float64, pcpConfigFile string) {
|
||||
|
|
|
@ -30,13 +30,13 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/constants"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
"github.com/spdfg/elektron/pcp"
|
||||
"github.com/spdfg/elektron/rapl"
|
||||
"github.com/spdfg/elektron/utilities"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func round(num float64) int {
|
||||
|
|
|
@ -28,13 +28,13 @@ import (
|
|||
"github.com/golang/protobuf/proto"
|
||||
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
|
||||
sched "github.com/mesos/mesos-go/api/v0/scheduler"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/def"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
"github.com/spdfg/elektron/pcp"
|
||||
"github.com/spdfg/elektron/powerCap"
|
||||
"github.com/spdfg/elektron/schedulers"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var master = flag.String("master", "", "Location of leading Mesos master -- <mesos-master>:<port>")
|
||||
|
|
|
@ -28,12 +28,12 @@ import (
|
|||
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
|
||||
"github.com/mesos/mesos-go/api/v0/mesosutil"
|
||||
sched "github.com/mesos/mesos-go/api/v0/scheduler"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/def"
|
||||
"github.com/spdfg/elektron/utilities"
|
||||
"github.com/spdfg/elektron/utilities/schedUtils"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/utilities"
|
||||
"github.com/spdfg/elektron/utilities/schedUtils"
|
||||
)
|
||||
|
||||
type BaseScheduler struct {
|
||||
|
|
|
@ -23,13 +23,13 @@ import (
|
|||
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
|
||||
sched "github.com/mesos/mesos-go/api/v0/scheduler"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/constants"
|
||||
"github.com/spdfg/elektron/def"
|
||||
"github.com/spdfg/elektron/utilities"
|
||||
"github.com/spdfg/elektron/utilities/mesosUtils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
"github.com/spdfg/elektron/utilities"
|
||||
"github.com/spdfg/elektron/utilities/mesosUtils"
|
||||
)
|
||||
|
||||
func coLocated(tasks map[string]bool, s BaseScheduler) {
|
||||
|
|
|
@ -24,10 +24,10 @@ import (
|
|||
|
||||
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
|
||||
sched "github.com/mesos/mesos-go/api/v0/scheduler"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/def"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type SchedPolicyContext interface {
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
package offerUtils
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"fmt"
|
||||
mesos "github.com/mesos/mesos-go/api/v0/mesosproto"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/constants"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func OfferAgg(offer *mesos.Offer) (float64, float64, float64) {
|
||||
|
|
|
@ -20,11 +20,11 @@ package schedUtils
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/def"
|
||||
"github.com/spdfg/elektron/utilities"
|
||||
"github.com/spdfg/elektron/elektronLogging"
|
||||
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spdfg/elektron/utilities"
|
||||
)
|
||||
|
||||
// Criteria for resizing the scheduling window.
|
||||
|
|
Reference in a new issue