mirror of
https://2025-dev.shylinux.com/x/20250213-machine
synced 2025-04-25 12:28:05 +08:00
add some
This commit is contained in:
parent
62cc9bdefa
commit
d28e211359
@ -16,8 +16,8 @@ type Process struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s Process) Weight(m *ice.Message, arg ...string) {
|
func (s Process) Weight(m *ice.Message, arg ...string) {
|
||||||
v, _ := mem.VirtualMemory()
|
|
||||||
stat := map[string]int{}
|
stat := map[string]int{}
|
||||||
|
v, _ := mem.VirtualMemory()
|
||||||
s.getList(func(p *process.Process, cmd string) {
|
s.getList(func(p *process.Process, cmd string) {
|
||||||
name, _ := p.Name()
|
name, _ := p.Name()
|
||||||
mem, _ := p.MemoryInfo()
|
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) {
|
func (s Process) List(m *ice.Message, arg ...string) {
|
||||||
stat := map[string]int{}
|
stat := map[string]int{}
|
||||||
m.Action(s.Weight)
|
|
||||||
s.getList(func(p *process.Process, cmd string) {
|
s.getList(func(p *process.Process, cmd string) {
|
||||||
if len(arg) > 0 && !strings.Contains(cmd, arg[0]) {
|
if len(arg) > 0 && !strings.Contains(cmd, arg[0]) {
|
||||||
return
|
return
|
||||||
@ -82,7 +81,7 @@ func (s Process) List(m *ice.Message, arg ...string) {
|
|||||||
stats[key] = kit.Format(value)
|
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{}) }
|
func init() { ice.Cmd("web.chat.dev.machine.process", Process{}) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user