系统 cpu 度量集编辑

系统 cpu 度量集提供 CPU 统计信息。

此度量集适用于以下平台:

  • FreeBSD
  • Linux
  • macOS
  • OpenBSD
  • Windows

配置编辑

cpu.metrics

此选项控制报告的 CPU 指标。该值是一个列表,支持三种指标类型 - percentagesnormalized_percentagesticks。默认值为 cpu.metrics: [percentages]

metricbeat.modules:
- module: system
  metricsets: [cpu]
  cpu.metrics: [percentages, normalized_percentages, ticks]

这是一个默认的度量集。如果主机模块未配置,此度量集默认启用。

字段

有关度量集中的每个字段的描述,请参见 导出字段 部分。

这是一个由此度量集生成的示例文档

{
    "@timestamp": "2017-10-12T08:05:34.853Z",
    "event": {
        "dataset": "system.cpu",
        "duration": 115000,
        "module": "system"
    },
    "host": {
        "cpu": {
            "usage": 0.0467
        }
    },
    "metricset": {
        "name": "cpu",
        "period": 10000
    },
    "service": {
        "type": "system"
    },
    "system": {
        "cpu": {
            "cores": 24,
            "idle": {
                "norm": {
                    "pct": 0.9532
                },
                "pct": 22.8778,
                "ticks": 5843152812
            },
            "iowait": {
                "norm": {
                    "pct": 0.0001
                },
                "pct": 0.002,
                "ticks": 335866
            },
            "irq": {
                "norm": {
                    "pct": 0.0017
                },
                "pct": 0.0401,
                "ticks": 7025540
            },
            "nice": {
                "norm": {
                    "pct": 0.0003
                },
                "pct": 0.006,
                "ticks": 1812301
            },
            "softirq": {
                "norm": {
                    "pct": 0.0008
                },
                "pct": 0.02,
                "ticks": 3581641
            },
            "steal": {
                "norm": {
                    "pct": 0
                },
                "pct": 0,
                "ticks": 0
            },
            "system": {
                "norm": {
                    "pct": 0.0169
                },
                "pct": 0.4068,
                "ticks": 67901836
            },
            "total": {
                "norm": {
                    "pct": 0.0467
                },
                "pct": 1.1202
            },
            "user": {
                "norm": {
                    "pct": 0.027
                },
                "pct": 0.6472,
                "ticks": 126846063
            }
        }
    }
}