Skip to content

Commit

Permalink
Merge pull request #10 from silenceshell/set-taskinfo-of-topic-bold
Browse files Browse the repository at this point in the history
set taskinfo of topic bold
  • Loading branch information
silenceshell committed Sep 29, 2021
2 parents 5db6c4a + 1ee9d69 commit 93eb83f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ func (t *TaskMonitor) GetTaskInfos() (infos []string) {
return
}

selfPid := os.Getpid()

memInfo := GetTotalMemInKiB()
total := memInfo.Total

Expand Down Expand Up @@ -138,6 +140,9 @@ func (t *TaskMonitor) GetTaskInfos() (infos []string) {
taskInfo := fmt.Sprintf(taskInfoFmt, pid, "root", procInfo.Stat.Priority, procInfo.Stat.Nice,
virt, res, shr, procInfo.Stat.State, float64(cpuUsage), memUsage,
convertDuration(uptime), procInfo.Cmdline)
if selfPid == pid {
taskInfo = fmt.Sprintf("[%v](mod:bold)", taskInfo)
}
taskInfos = append(taskInfos, taskInfo)
}
}
Expand Down

0 comments on commit 93eb83f

Please sign in to comment.