5.2. 检索实时指标
您可以使用 PCP CLI 工具检索实时指标。
流程
要输出特定指标的当前值,请输入以下命令:
# pmval -f 1 disk.partitions.write在本例中,会显示写入磁盘分区的指标实例。PCP 将写入次数从计数器值转换为速率值。
f 1参数指定将值缩写为一个十进制位置。输出示例:
metric: disk.partitions.write host: satellite.example.com semantics: cumulative counter (converting to rate) units: count (converting to count / sec) samples: all vda1 vda2 sr0 0.0 12.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 2.0 0.0要每 2 秒打印系统性能概述,请输入以下命令:
# pmstat -t 2sec