Add timestamps to debug output (#5)

This commit is contained in:
Pedro Pombeiro 2018-01-30 11:45:14 +01:00 committed by Ivan Daniluk
parent f9a5db3525
commit 9f84e6a17a
1 changed files with 3 additions and 3 deletions

View File

@ -48,21 +48,21 @@ func main() {
fmt.Println("[ERROR]:", err)
continue
}
fmt.Println("CPU:", cpu)
fmt.Printf("[%v] CPU: %v\n", time.Now().Format(time.RFC3339), cpu)
usedMem, err := src.MemStats()
if err != nil {
fmt.Println("[ERROR]:", err)
continue
}
fmt.Println("Used Mem:", usedMem)
fmt.Printf("[%v] Used Mem: %v\n", time.Now().Format(time.RFC3339), usedMem)
rx, tx, err := src.Netstats()
if err != nil {
fmt.Println("[ERROR]:", err)
continue
}
fmt.Printf("Netstats (rx/tx): %v/%v bytes\n", rx, tx)
fmt.Printf("[%v] Netstats (rx/tx): %v/%v bytes\n", time.Now().Format(time.RFC3339), rx, tx)
time.Sleep(*interval)
}