Provide pcp config file from commandline.

Taking pcp config file name (or path) from commandline.
In scheduler.go, also checking to see if provided pcp config file
exists. If not, then exitting.
This commit is contained in:
Pradyumna Kaushik 2018-10-04 13:57:35 -04:00
parent 8e87bcb439
commit 1e9828c35b
4 changed files with 20 additions and 9 deletions

View file

@ -18,9 +18,9 @@ import (
)
func StartPCPLogAndExtremaDynamicCap(quit chan struct{}, logging *bool, hiThreshold, loThreshold float64,
logMType chan elekLogDef.LogMessageType, logMsg chan string) {
logMType chan elekLogDef.LogMessageType, logMsg chan string, pcpConfigFile string) {
const pcpCommand string = "pmdumptext -m -l -f '' -t 1.0 -d , -c config"
const pcpCommand string = "pmdumptext -m -l -f '' -t 1.0 -d , -c " + pcpConfigFile
cmd := exec.Command("sh", "-c", pcpCommand)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}

View file

@ -31,9 +31,9 @@ func getNextCapValue(curCapValue float64, precision int) float64 {
}
func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, hiThreshold, loThreshold float64,
logMType chan elekLogDef.LogMessageType, logMsg chan string) {
logMType chan elekLogDef.LogMessageType, logMsg chan string, pcpConfigFile string) {
const pcpCommand string = "pmdumptext -m -l -f '' -t 1.0 -d , -c config"
const pcpCommand string = "pmdumptext -m -l -f '' -t 1.0 -d , -c " + pcpConfigFile
cmd := exec.Command("sh", "-c", pcpCommand)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}