Skip to content

Commit

Permalink
Add CPU percentage to cpu metricset and add Cores metricset (#1596)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin authored and tsg committed May 10, 2016
1 parent 1eab5b0 commit 11a9447
Show file tree
Hide file tree
Showing 15 changed files with 595 additions and 119 deletions.
183 changes: 146 additions & 37 deletions metricbeat/docs/fields.asciidoc

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion metricbeat/etc/beat.yml
Expand Up @@ -72,10 +72,13 @@ metricbeat:

# System module
- module: system
metricsets: ["cpu", "filesystem", "fsstats", "memory", "process"]
metricsets: ["cpu", "cores", "filesystem", "fsstats", "memory", "process"]
enabled: true
period: 2s

# Per core cpu statistics
#cpu_per_core: false

# Zookeeper module
- module: zookeeper
metricsets: ["mntr"]
Expand Down
154 changes: 117 additions & 37 deletions metricbeat/etc/fields.yml
Expand Up @@ -86,164 +86,164 @@ apache:
- name: hostname
type: keyword
description: >
Apache hostname
Apache hostname.
- name: totalAccesses
type: integer
description: >
Total number of access requests
Total number of access requests.
- name: totalKBytes
type: integer
description: >
Total number of kilobytes served
Total number of kilobytes served.
- name: reqPerSec
type: float
description: >
Requests per second
Requests per second.
- name: bytesPerSec
type: float
description: >
Bytes per second
Bytes per second.
- name: bytesPerReq
type: float
description: >
Bytes per request
Bytes per request.
- name: busyWorkers
type: integer
description: >
Number of busy workers
Number of busy workers.
- name: idleWorkers
type: integer
description: >
Number of idle workers
Number of idle workers.
- name: uptime
type: group
description: >
Uptime stats
Uptime stats.
fields:
- name: serverUptimeSeconds
type: integer
description: >
Server uptime in seconds
Server uptime in seconds.
- name: uptime
type: integer
description: >
Server uptime
Server uptime.
- name: cpu
type: group
description: >
CPU stats
CPU stats.
fields:
- name: cpuLoad
type: float
description: >
CPU Load
CPU Load.
- name: cpuUser
type: float
description: >
cpu user load
CPU user load.
- name: cpuSystem
type: float
description: >
System cpu
System cpu.
- name: cpuChildrenUser
type: float
description: >
CPU of children user
CPU of children user.
- name: cpuChildrenSystem
type: float
description: >
cpu of children system
CPU of children system.
- name: connections
type: group
description: >
Connection stats
Connection stats.
fields:
- name: connsTotal
type: integer
description: >
Total connections
Total connections.
- name: connsAsyncWriting
type: integer
description: >
Async connectin writing
Async connection writing.
- name: connsAsyncKeepAlive
type: integer
description: >
Async keeped alive connetions
Async keeped alive connections.
- name: connsAsyncClosing
type: integer
description: >
Async closed connections
Async closed connections.
- name: load
type: group
description: >
Load averages
Load averages.
fields:
- name: load1
type: float
description: >
Load average for the last minute
Load average for the last minute.
- name: load5
type: float
description: >
Load avarage for the last 5 minutes
Load average for the last 5 minutes.
- name: load15
type: float
description: >
Load aferage for the last 15 minutes
Load average for the last 15 minutes.
- name: scoreboard
type: group
description: >
Scoreboard metrics
Scoreboard metrics.
fields:
- name: startingUp
type: integer
description: >
Starting up
Starting up.
- name: readingRequest
type: integer
description: >
Reading requests
Reading requests.
- name: sendingReply
type: integer
description: >
Sending Reply
Sending Reply.
- name: keepalive
type: integer
description: >
Keep alive
Keep alive.
- name: dnsLookup
type: integer
description: >
Dns Lookups
Dns Lookups.
- name: closingConnection
type: integer
description: >
Closing connections
Closing connections.
- name: logging
type: integer
description: >
Logging
- name: gracefullyFinishing
type: integer
description: >
Gracefully finishing
Gracefully finishing.
- name: idleCleanup
type: integer
description: >
Idle cleanups
- name: openSlot
type: integer
description: >
Open slots
Open slots.
- name: waitingForConnection
type: integer
description: >
Waiting for connections
Waiting for connections.
- name: total
type: integer
description: >
Total
Total.
mysql:
type: group
description: >
Expand Down Expand Up @@ -359,6 +359,69 @@ system:
description: >
System status metrics, like CPU and memory usage, that are collected from the operating system.
fields:
- name: system-cores
type: group
description: >
`system-cores` contains local cpu core stats.
fields:
- name: core
type: integer
description: >
CPU Core number.
- name: user
type: integer
description: >
The amount of CPU time spent in user space.
- name: user_p
type: float
description: >
The percentage of CPU time spent in user space. On multi-core systems, you can have percentages that are greater than 100%.
For example, if 3 cores are at 60% use, then the `cpu.user_p` will be 180%.
- name: nice
type: integer
description: >
The amount of CPU time spent on low-priority processes.
- name: system
type: integer
description: >
The amount of CPU time spent in kernel space.
- name: system_p
type: float
description: >
The percentage of CPU time spent in kernel space.
- name: idle
type: integer
description: >
The amount of CPU time spent idle.
- name: iowait
type: integer
description: >
The amount of CPU time spent in wait (on disk).
- name: irq
type: integer
description: >
The amount of CPU time spent servicing and handling hardware interrupts.
- name: softirq
type: integer
description:
The amount of CPU time spent servicing and handling software interrupts.

- name: steal
type: integer
description: >
The amount of CPU time spent in involuntary wait by the virtual CPU while the hypervisor
was servicing another processor.
Available only on Unix.
- name: system-cpu
type: group
description: >
Expand Down Expand Up @@ -417,6 +480,23 @@ system:
was servicing another processor.
Available only on Unix.
- name: load
type: group
description: >
Load averages.
fields:
- name: load1
type: float
description: >
Load average for the last minute.
- name: load5
type: float
description: >
Load average for the last 5 minutes.
- name: load15
type: float
description: >
Load average for the last 15 minutes.
- name: system-filesystem
type: group
description: >
Expand Down
1 change: 1 addition & 0 deletions metricbeat/include/list.go
Expand Up @@ -16,6 +16,7 @@ import (
_ "github.com/elastic/beats/metricbeat/module/redis"
_ "github.com/elastic/beats/metricbeat/module/redis/info"
_ "github.com/elastic/beats/metricbeat/module/system"
_ "github.com/elastic/beats/metricbeat/module/system/cores"
_ "github.com/elastic/beats/metricbeat/module/system/cpu"
_ "github.com/elastic/beats/metricbeat/module/system/filesystem"
_ "github.com/elastic/beats/metricbeat/module/system/fsstats"
Expand Down
50 changes: 50 additions & 0 deletions metricbeat/metricbeat.template-es2x.json
Expand Up @@ -250,6 +250,43 @@
"rtt": {
"type": "long"
},
"system-cores": {
"properties": {
"core": {
"type": "integer"
},
"idle": {
"type": "integer"
},
"iowait": {
"type": "integer"
},
"irq": {
"type": "integer"
},
"nice": {
"type": "integer"
},
"softirq": {
"type": "integer"
},
"steal": {
"type": "integer"
},
"system": {
"type": "integer"
},
"system_p": {
"type": "float"
},
"user": {
"type": "integer"
},
"user_p": {
"type": "float"
}
}
},
"system-cpu": {
"properties": {
"idle": {
Expand All @@ -261,6 +298,19 @@
"irq": {
"type": "integer"
},
"load": {
"properties": {
"load1": {
"type": "float"
},
"load15": {
"type": "float"
},
"load5": {
"type": "float"
}
}
},
"nice": {
"type": "integer"
},
Expand Down

0 comments on commit 11a9447

Please sign in to comment.