|
|
@ -98,15 +98,16 @@ table, th, td { |
|
|
|
// Statistics table
|
|
|
|
_, _ = fmt.Fprintf(w, "<p>Statistics (%d)</p>", runtime.NumGoroutine()) |
|
|
|
_, _ = fmt.Fprintf(w, "<table style=\"border=4px solid\">") |
|
|
|
_, _ = fmt.Fprintf(w, "<tr><th>Last Refresh Time</th><th>Uptime</th><th>CPU</th><th>Mem</th><th>Disk</th><th>Total</th><th>Upload</th><th>Download</th></tr>\n") |
|
|
|
_, _ = fmt.Fprintf(w, "<th>Platform</th><th>CPU</th><th>Mem</th><th>Disk</th><tr><th>Last Refresh Time</th><th>Uptime</th><th>Total</th><th>Upload</th><th>Download</th></tr>\n") |
|
|
|
trafficUp := atomic.LoadInt64(&s.trafficUp) |
|
|
|
trafficDown := atomic.LoadInt64(&s.trafficDown) |
|
|
|
_, _ = fmt.Fprintf(w, "<tr><td>%v</td><td>%v</td><td>%v</td><td>%v</td><td>%v</td><td>%v</td><td>%v</td><td>%v</td></tr>\n", |
|
|
|
date(time.Now()), |
|
|
|
uptime(), |
|
|
|
_, _ = fmt.Fprintf(w, "<tr><td>%v</td><td>%v</td><td>%v</td><td>%v</td><td>%v</td><td>%v</td><td>%v</td><td>%v</td><td>%v</td></tr>\n", |
|
|
|
platform(), |
|
|
|
cpu(), |
|
|
|
mem(), |
|
|
|
disk(), |
|
|
|
date(time.Now()), |
|
|
|
uptime(), |
|
|
|
byteCountSI(trafficUp+trafficDown), |
|
|
|
byteCountSI(trafficUp), |
|
|
|
byteCountSI(trafficDown), |
|
|
|