Tied metric columns to values, next step will be determining how to store them and retrieve them
This commit is contained in:
parent
58c6bfe7a8
commit
4e2a1d99fd
1 changed files with 11 additions and 6 deletions
11
pcp/pcp.go
11
pcp/pcp.go
|
@ -1,10 +1,10 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"bufio"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -34,11 +34,16 @@ func main() {
|
||||||
// Throw away first set of results
|
// Throw away first set of results
|
||||||
scanner.Scan()
|
scanner.Scan()
|
||||||
|
|
||||||
|
|
||||||
seconds := 0
|
seconds := 0
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
fmt.Println("Second ", seconds , " val: ", strings.Split(scanner.Text(), ","))
|
fmt.Printf("Second: %d\n", seconds)
|
||||||
|
for i, val := range strings.Split(scanner.Text(), ",") {
|
||||||
|
fmt.Printf("host metric: %s val: %s\n", headers[i], val)
|
||||||
|
}
|
||||||
|
|
||||||
seconds++
|
seconds++
|
||||||
|
|
||||||
|
fmt.Println("--------------------------------")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Reference in a new issue