Implemented a scheduling tracer. Logs time date and host:task-ID. Made log prefix more global since it needs to be constant for all log files generated.

This commit is contained in:
Renan DelValle 2017-01-03 20:30:21 -05:00
parent ab9fda5513
commit b73c30a8bf
4 changed files with 9 additions and 8 deletions

View file

@ -11,6 +11,7 @@ To Do:
* Write test code for each scheduler (This should be after the design change)
* Some of the constants in constants/constants.go can vary based on the environment.
Possible to setup the constants at runtime based on the environment?
* Retrofit schedulers for scheduling tracing
**Requires [Performance Co-Pilot](http://pcp.io/) tool pmdumptext to be installed on the

View file

@ -61,13 +61,12 @@ func StartLogAndDynamicCap(quit chan struct{}, logging *bool, prefix string, hiT
const pcpCommand string = "pmdumptext -m -l -f '' -t 1.0 -d , -c config"
cmd := exec.Command("sh", "-c", pcpCommand)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
startTime := time.Now().Format("20060102150405")
if hiThreshold < loThreshold {
log.Println("High threshold is lower than low threshold!")
}
logFile, err := os.Create("./" + prefix + startTime + ".pcplog")
logFile, err := os.Create("./" + prefix + ".pcplog")
if err != nil {
log.Fatal(err)
}

View file

@ -13,9 +13,8 @@ func Start(quit chan struct{}, logging *bool, prefix string) {
const pcpCommand string = "pmdumptext -m -l -f '' -t 1.0 -d , -c config"
cmd := exec.Command("sh", "-c", pcpCommand)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
startTime := time.Now().Format("20060102150405")
logFile, err := os.Create("./" + prefix + startTime + ".pcplog")
logFile, err := os.Create("./" + prefix + ".pcplog")
if err != nil {
log.Fatal(err)
}

View file

@ -55,8 +55,10 @@ func main() {
for _, task := range tasks {
fmt.Println(task)
}
startTime := time.Now().Format("20060102150405")
logPrefix := *pcplogPrefix + "_" + startTime
scheduler := schedulers.NewPistonCapper(tasks, *ignoreWatts)
scheduler := schedulers.NewBPMaxMinWatts(tasks, *ignoreWatts, logPrefix)
driver, err := sched.NewMesosSchedulerDriver(sched.DriverConfig{
Master: *master,
Framework: &mesos.FrameworkInfo{
@ -70,9 +72,9 @@ func main() {
return
}
go pcp.Start(scheduler.PCPLog, &scheduler.RecordPCP, *pcplogPrefix)
//go pcp.StartLogAndDynamicCap(scheduler.PCPLog, &scheduler.RecordPCP, *pcplogPrefix, *hiThreshold, *loThreshold)
time.Sleep(1 * time.Second)
go pcp.Start(scheduler.PCPLog, &scheduler.RecordPCP, logPrefix)
//go pcp.StartLogAndDynamicCap(scheduler.PCPLog, &scheduler.RecordPCP, logPrefix, *hiThreshold, *loThreshold)
time.Sleep(1 * time.Second) //Log for a second since the first second is garbage values from PCP
// Attempt to handle signint to not leave pmdumptext running
// Catch interrupt