diff --git a/src/monitor/process.go b/src/monitor/process.go index f8f5d8e..08e3536 100644 --- a/src/monitor/process.go +++ b/src/monitor/process.go @@ -16,8 +16,8 @@ type Process struct { } func (s Process) Weight(m *ice.Message, arg ...string) { - v, _ := mem.VirtualMemory() stat := map[string]int{} + v, _ := mem.VirtualMemory() s.getList(func(p *process.Process, cmd string) { name, _ := p.Name() mem, _ := p.MemoryInfo() @@ -31,7 +31,6 @@ func (s Process) Weight(m *ice.Message, arg ...string) { } func (s Process) List(m *ice.Message, arg ...string) { stat := map[string]int{} - m.Action(s.Weight) s.getList(func(p *process.Process, cmd string) { if len(arg) > 0 && !strings.Contains(cmd, arg[0]) { return @@ -82,7 +81,7 @@ func (s Process) List(m *ice.Message, arg ...string) { stats[key] = kit.Format(value) } }) - m.StatusTimeCount(stats).SortIntR("rss") + m.StatusTimeCount(stats).SortIntR("rss").Action(s.Weight) } func init() { ice.Cmd("web.chat.dev.machine.process", Process{}) }