第六十章 使用 ^PERFSAMPLE 监控进程 - 预定义分析示例
预定义分析示例
以下是从过程状态维度开始的分析示例。
在此示例中,^PERFSAMPLE
在 319994
个样本中找到了 76755
个处于可样本状态的进程样本(如果选择了忽略空闲的选项,则为非空闲):
– PERFSAMPLE for Local Process Activity. 3.89s at 11/17/2020 16:59:59 76755 events in 319994 samples [24.0 %-total] | CPULoad* 8.22 Multiple jobs included: 2191 samples per job ----------------------------'?' for help---------------------------- Process State [24.0 %-total] GGET [8.46 %-total] RUN [5.88 %-total] GDEF [3.16 %-total] GSETW [1.63 %-total] BSETW [1.21 %-total] GDEFW [1.18 %-total] GGETW [0.931 %-total] SEMW [0.685 %-total] GSET [0.311 %-total] LOCKW [0.144 %-total] LOCK [0.0644 %-total] INCRW [0.0641 %-total] BSET [0.0513 %-total]
最初,这些值显示为样本总数的百分比。在这种情况下采样的最常见的 Process State
值是 GGET
,占 319994
个样本总数的 8.46%
。
按 c
循环显示此计数的显示方式。例如,可以将上述信息显示为样本的原始计数:
Process State [76755] > GGET [27083] RUN [18823] GDEF [10121]
还可以将信息查看为合格样本的百分比(在这种情况下,具有非空闲进程状态的样本):
Process State [24.0 %-total] > GGET [35.3 %-subset] RUN [24.5 %-subset] GDEF [13.2 %-subset]
最后,可以查看每个状态的平均并发作业数:
Process State [24.0 %-total] GGET [12.4 jobs] RUN [8.59 jobs] GDEF [4.62 jobs]
使用右箭头键选择 GGET
移动到下一个维度,为第一个维度具有值 GGET
的样本排序该维度的值。可以使用箭头键在维度之间自由导航。
创建自定义分析
从主登录页面选择“新建分析”选项以创建自定义分析。还可以使用以下快捷方式之一创建自定义分析:
Key Input | Shortcut |
- key| 向当前分析添加维度(在分析中时)
- key| 以当前项目作为第一个维度开始新的分析
添加新分析会将带到以下屏幕:
New Analysis: Specify a comma-delimited list of dimensions upon which to analyze samples. For example, "state,ns,rou" means first count each unique state the sampled processes were in; then for each state, count the namespace from the samples in that state; and finally for each state->namespace pair, count each unique routine name. In other words, report on routines by namespace by state. The following dimensions are available: cpu - Using CPU? (process state indicates expected CPU use) ns - Namespace (current namespace) pid - PID (process ID) rou - Routine (name of current routine) state - Process State (process state string, e.g. GSETW) trace - Kernel Trace (alternative to 'state' w/ kernel-level detail) waits - Kernel Wait State (kernel-level condition that delayed the process) wtrace - Reverse Kernel Trace (revese kernel trace, stop at any wait state) Enter dimension list:
从这里,按照提示的描述输入想要分析的维度列表。按下 Enter
后,以按上述方式导航分析。