mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
update go version, deps for runc v1.0.0-rc92
This commit is contained in:
@@ -4,13 +4,14 @@ package collector
|
||||
|
||||
import (
|
||||
linuxproc "github.com/c9s/goprocinfo/linux"
|
||||
"github.com/opencontainers/runc/libcontainer/system"
|
||||
)
|
||||
|
||||
var sysMemTotal = getSysMemTotal()
|
||||
var clockTicksPerSecond = uint64(system.GetClockTicks())
|
||||
|
||||
const nanoSecondsPerSecond = 1e9
|
||||
const (
|
||||
clockTicksPerSecond uint64 = 100
|
||||
nanoSecondsPerSecond = 1e9
|
||||
)
|
||||
|
||||
func getSysMemTotal() int64 {
|
||||
stat, err := linuxproc.ReadMemInfo("/proc/meminfo")
|
||||
|
||||
@@ -5,10 +5,12 @@ package collector
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/bcicen/ctop/config"
|
||||
"github.com/bcicen/ctop/models"
|
||||
"github.com/opencontainers/runc/libcontainer"
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
"github.com/opencontainers/runc/types"
|
||||
|
||||
"github.com/bcicen/ctop/config"
|
||||
"github.com/bcicen/ctop/models"
|
||||
)
|
||||
|
||||
// Runc collector
|
||||
@@ -112,7 +114,7 @@ func (c *Runc) ReadMem(stats *cgroups.Stats) {
|
||||
c.MemPercent = percent(float64(c.MemUsage), float64(c.MemLimit))
|
||||
}
|
||||
|
||||
func (c *Runc) ReadNet(interfaces []*libcontainer.NetworkInterface) {
|
||||
func (c *Runc) ReadNet(interfaces []*types.NetworkInterface) {
|
||||
var rx, tx int64
|
||||
for _, network := range interfaces {
|
||||
rx += int64(network.RxBytes)
|
||||
|
||||
Reference in New Issue
Block a user