From d28e211359db904056df84f0a37916de1e367a21 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 1 Mar 2025 17:44:57 +0800 Subject: [PATCH] add some --- src/monitor/process.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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{}) }