Added Error state. Fixed bug with tasks returning error because 0.0 watts was requested as a resource. Changed name to be more readable by eliminating electron. PCP logs can now have a prefix.

This commit is contained in:
Renan DelValle 2016-10-07 19:29:36 -04:00
parent 52d012a7ee
commit 5dd64f1e16
3 changed files with 25 additions and 23 deletions

View file

@ -8,13 +8,13 @@ import (
"os"
)
func Start(quit chan struct{}, logging *bool) {
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)
startTime := time.Now().Format("20060102150405")
logFile, err := os.Create("./"+startTime+".pcplog")
logFile, err := os.Create("./"+prefix+startTime+".pcplog")
if err != nil {
log.Fatal(err)
}