mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
24 lines
304 B
Go
24 lines
304 B
Go
|
package collector
|
||
|
|
||
|
import (
|
||
|
"math"
|
||
|
)
|
||
|
|
||
|
type Metrics struct {
|
||
|
CPUUtil int
|
||
|
NetTx int64
|
||
|
NetRx int64
|
||
|
MemLimit int64
|
||
|
MemPercent int
|
||
|
MemUsage int64
|
||
|
}
|
||
|
|
||
|
type Collector interface {
|
||
|
Stream() chan Metrics
|
||
|
Stop()
|
||
|
}
|
||
|
|
||
|
func round(num float64) int {
|
||
|
return int(num + math.Copysign(0.5, num))
|
||
|
}
|