pt-stalk top CPU usage is useless

Reported by Daniel Nichter on 2012-04-07
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Toolkit
Undecided
Unassigned

Bug Description

pt-stalk runs "top -bn1" which means that a single iteration of top is ran. The result is that top can't calculate a useful CPU usage because it needs a basis of comparison. From https://bugzilla.redhat.com/show_bug.cgi?id=174619 we read:

The top command calculates %CPU by looking at the change in CPU time values between samples. When you first run it, it has no previous sample to compare to, so these initial values are the percentages since boot. It means you need at least two loops.

Michael discovered this because he specifically wanted historical CPU usage, knowing that it was running high, but the collected top output from pt-stalk was only showing 6% CPU usage--way below reality.

Perhaps we need to run "top -bn$OPT_RUN_TIME".

description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers