Removed Degree of Collocation logger.
This commit is contained in:
parent
39ba273d1a
commit
bcc2b4e4cc
10 changed files with 6 additions and 179 deletions
|
@ -12,18 +12,14 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/mesos/mesos-go/api/v0/scheduler"
|
||||
"github.com/montanaflynn/stats"
|
||||
elekLogDef "gitlab.com/spdf/elektron/logging/def"
|
||||
"gitlab.com/spdf/elektron/pcp"
|
||||
"gitlab.com/spdf/elektron/rapl"
|
||||
"gitlab.com/spdf/elektron/schedulers"
|
||||
)
|
||||
|
||||
func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThreshold, loThreshold float64,
|
||||
logMType chan elekLogDef.LogMessageType, logMsg chan string, pcpConfigFile string, s scheduler.Scheduler) {
|
||||
logMType chan elekLogDef.LogMessageType, logMsg chan string, pcpConfigFile string) {
|
||||
|
||||
baseSchedRef := s.(*schedulers.BaseScheduler)
|
||||
var pcpCommand string = "pmdumptext -m -l -f '' -t 1.0 -d , -c " + pcpConfigFile
|
||||
cmd := exec.Command("sh", "-c", pcpCommand, pcpConfigFile)
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
|
@ -50,9 +46,6 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
|
|||
|
||||
headers := strings.Split(scanner.Text(), ",")
|
||||
|
||||
logMType <- elekLogDef.DEG_COL
|
||||
logMsg <- "CPU Variance, CPU Task Share Variance, Memory Variance, Memory Task Share Variance"
|
||||
|
||||
powerIndexes := make([]int, 0, 0)
|
||||
powerHistories := make(map[string]*ring.Ring)
|
||||
indexToHost := make(map[int]string)
|
||||
|
@ -91,39 +84,6 @@ func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThresh
|
|||
logMType <- elekLogDef.PCP
|
||||
logMsg <- text
|
||||
|
||||
memUtils := pcp.MemUtilPerNode(text)
|
||||
memTaskShares := make([]float64, len(memUtils))
|
||||
|
||||
cpuUtils := pcp.CpuUtilPerNode(text)
|
||||
cpuTaskShares := make([]float64, len(cpuUtils))
|
||||
|
||||
for i := 0; i < 8; i++ {
|
||||
host := fmt.Sprintf("stratos-00%d.cs.binghamton.edu", i+1)
|
||||
if slaveID, ok := baseSchedRef.HostNameToSlaveID[host]; ok {
|
||||
baseSchedRef.TasksRunningMutex.Lock()
|
||||
tasksRunning := len(baseSchedRef.Running[slaveID])
|
||||
baseSchedRef.TasksRunningMutex.Unlock()
|
||||
if tasksRunning > 0 {
|
||||
cpuTaskShares[i] = cpuUtils[i] / float64(tasksRunning)
|
||||
memTaskShares[i] = memUtils[i] / float64(tasksRunning)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Variance in resource utilization shows how the current workload has been distributed.
|
||||
// However, if the number of tasks running are not equally distributed, utilization variance figures become
|
||||
// less relevant as they do not express the distribution of CPU intensive tasks.
|
||||
// We thus also calculate `task share variance`, which basically signifies how the workload is distributed
|
||||
// across each node per share.
|
||||
|
||||
cpuVariance, _ := stats.Variance(cpuUtils)
|
||||
cpuTaskSharesVariance, _ := stats.Variance(cpuTaskShares)
|
||||
memVariance, _ := stats.Variance(memUtils)
|
||||
memTaskSharesVariance, _ := stats.Variance(memTaskShares)
|
||||
|
||||
logMType <- elekLogDef.DEG_COL
|
||||
logMsg <- fmt.Sprintf("%f, %f, %f, %f", cpuVariance, cpuTaskSharesVariance, memVariance, memTaskSharesVariance)
|
||||
|
||||
totalPower := 0.0
|
||||
for _, powerIndex := range powerIndexes {
|
||||
power, _ := strconv.ParseFloat(split[powerIndex], 64)
|
||||
|
|
|
@ -13,13 +13,10 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/mesos/mesos-go/api/v0/scheduler"
|
||||
"github.com/montanaflynn/stats"
|
||||
"gitlab.com/spdf/elektron/constants"
|
||||
elekLogDef "gitlab.com/spdf/elektron/logging/def"
|
||||
"gitlab.com/spdf/elektron/pcp"
|
||||
"gitlab.com/spdf/elektron/rapl"
|
||||
"gitlab.com/spdf/elektron/schedulers"
|
||||
"gitlab.com/spdf/elektron/utilities"
|
||||
)
|
||||
|
||||
|
@ -34,9 +31,8 @@ func getNextCapValue(curCapValue float64, precision int) float64 {
|
|||
}
|
||||
|
||||
func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiThreshold, loThreshold float64,
|
||||
logMType chan elekLogDef.LogMessageType, logMsg chan string, pcpConfigFile string, s scheduler.Scheduler) {
|
||||
logMType chan elekLogDef.LogMessageType, logMsg chan string, pcpConfigFile string) {
|
||||
|
||||
baseSchedRef := s.(*schedulers.BaseScheduler)
|
||||
var pcpCommand string = "pmdumptext -m -l -f '' -t 1.0 -d , -c " + pcpConfigFile
|
||||
cmd := exec.Command("sh", "-c", pcpCommand, pcpConfigFile)
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
|
@ -64,9 +60,6 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
|
|||
|
||||
headers := strings.Split(scanner.Text(), ",")
|
||||
|
||||
logMType <- elekLogDef.DEG_COL
|
||||
logMsg <- "CPU Variance, CPU Task Share Variance, Memory Variance, Memory Task Share Variance"
|
||||
|
||||
powerIndexes := make([]int, 0, 0)
|
||||
powerHistories := make(map[string]*ring.Ring)
|
||||
indexToHost := make(map[int]string)
|
||||
|
@ -110,39 +103,6 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiTh
|
|||
logMType <- elekLogDef.PCP
|
||||
logMsg <- text
|
||||
|
||||
memUtils := pcp.MemUtilPerNode(text)
|
||||
memTaskShares := make([]float64, len(memUtils))
|
||||
|
||||
cpuUtils := pcp.CpuUtilPerNode(text)
|
||||
cpuTaskShares := make([]float64, len(cpuUtils))
|
||||
|
||||
for i := 0; i < 8; i++ {
|
||||
host := fmt.Sprintf("stratos-00%d.cs.binghamton.edu", i+1)
|
||||
if slaveID, ok := baseSchedRef.HostNameToSlaveID[host]; ok {
|
||||
baseSchedRef.TasksRunningMutex.Lock()
|
||||
tasksRunning := len(baseSchedRef.Running[slaveID])
|
||||
baseSchedRef.TasksRunningMutex.Unlock()
|
||||
if tasksRunning > 0 {
|
||||
cpuTaskShares[i] = cpuUtils[i] / float64(tasksRunning)
|
||||
memTaskShares[i] = memUtils[i] / float64(tasksRunning)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Variance in resource utilization shows how the current workload has been distributed.
|
||||
// However, if the number of tasks running are not equally distributed, utilization variance figures become
|
||||
// less relevant as they do not express the distribution of CPU intensive tasks.
|
||||
// We thus also calculate `task share variance`, which basically signifies how the workload is distributed
|
||||
// across each node per share.
|
||||
|
||||
cpuVariance, _ := stats.Variance(cpuUtils)
|
||||
cpuTaskSharesVariance, _ := stats.Variance(cpuTaskShares)
|
||||
memVariance, _ := stats.Variance(memUtils)
|
||||
memTaskSharesVariance, _ := stats.Variance(memTaskShares)
|
||||
|
||||
logMType <- elekLogDef.DEG_COL
|
||||
logMsg <- fmt.Sprintf("%f, %f, %f, %f", cpuVariance, cpuTaskSharesVariance, memVariance, memTaskSharesVariance)
|
||||
|
||||
totalPower := 0.0
|
||||
for _, powerIndex := range powerIndexes {
|
||||
power, _ := strconv.ParseFloat(split[powerIndex], 64)
|
||||
|
|
Reference in a new issue