CPU

Description

Collect cpu usage: average cpu, number of processes running and processes sorted by cpu usage.

Parameters

ParameterDescriptionTypeDefault
cpu_minFilters out processes using less than this cpu usage. -1 to disablefloat5.0
max_processesMax amount of processes to collect in the sorted field. -1 for allint5

Schema

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Cpu",
    "description": "CPU statistics",
    "properties": {
        "average": {
            "description": "Average CPU",
            "type": "number",
            "minimum": 0
        },
        "processes": {
            "description": "Number of processes running",
            "type": "integer",
            "minimum": 0
        },
        "sorted": {
            "description": "Processes sorted by CPU usage",
            "type": "array",
            "items": {
                "$ref": "#/$defs/process"
            }
        }
    },
    "$defs": {
        "process": {
            "type": "object",
            "description": "Process information",
            "properties": {
                "pid": {
                    "description": "Process ID of the process",
                    "type": "integer"
                },
                "user": {
                    "description": "User who started the process",
                    "type": "string"
                },
                "cmd": {
                    "description": "Command that launched the process",
                    "type": "string"
                },
                "cpu": {
                    "description": "Process' current utilization as a percentage of total CPU time",
                    "type": "number"
                },
                "ram": {
                    "description": "Memory in use by this process in kb",
                    "type": "integer"
                },
                "uptime": {
                    "description": "Age of the process in seconds",
                    "type": "integer"
                }
            }
        }
    },
    "type": "object"
}

Measurement configuration

...
cpu:
  plugin: "dc_measurements/Cpu"
  topic_output: "/dc/measurement/cpu"
  tags: ["flb_stdout"]
  max_processes: 10
  cpu_min: 10.0