mirror of
https://github.com/bcicen/ctop.git
synced 2025-11-09 20:55:39 +01:00
refactor container collector into subpackage
This commit is contained in:
23
collector/main.go
Normal file
23
collector/main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user