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