Skip to content

Commit

Permalink
fix cpu usage scale
Browse files Browse the repository at this point in the history
  • Loading branch information
lqs committed Oct 11, 2023
1 parent 408fd52 commit 881e485
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/processdetail.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func NewProcessDetailView(params ProcessDetailViewParams) ProcessDetailView {

form.AddTextView("PID", strconv.Itoa(params.Process.PID), 0, 1, true, false)
form.AddTextView("Name", name, 0, 1, true, false)
form.AddTextView("%CPU (average)", fmt.Sprintf("%.1f%%", cpuPercent*100), 0, 1, true, false)
form.AddTextView("%CPU (average)", fmt.Sprintf("%.1f%%", cpuPercent), 0, 1, true, false)

if params.Process.Agent {
form.AddButton("Stack Dump", params.OnShowStack)
Expand All @@ -58,7 +58,7 @@ func NewProcessDetailView(params ProcessDetailViewParams) ProcessDetailView {
ctx, cancel := context.WithCancel(context.Background())
NewReloader(ctx, func() {
cpuPercent, _ := p.CPUPercent()
form.GetFormItemByLabel("%CPU (average)").(*tview.TextView).SetText(fmt.Sprintf("%.1f%%", cpuPercent*100))
form.GetFormItemByLabel("%CPU (average)").(*tview.TextView).SetText(fmt.Sprintf("%.1f%%", cpuPercent))

})

Expand Down

0 comments on commit 881e485

Please sign in to comment.