diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 37fd546a72d..421d8ac5d5e 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -107,61 +107,61 @@ Apache HTTPD server metrics collected from the mod_status module. type: keyword -Apache hostname +Apache hostname. ==== apache-status.totalAccesses type: integer -Total number of access requests +Total number of access requests. ==== apache-status.totalKBytes type: integer -Total number of kilobytes served +Total number of kilobytes served. ==== apache-status.reqPerSec type: float -Requests per second +Requests per second. ==== apache-status.bytesPerSec type: float -Bytes per second +Bytes per second. ==== apache-status.bytesPerReq type: float -Bytes per request +Bytes per request. ==== apache-status.busyWorkers type: integer -Number of busy workers +Number of busy workers. ==== apache-status.idleWorkers type: integer -Number of idle workers +Number of idle workers. === uptime Fields -Uptime stats +Uptime stats. @@ -169,19 +169,19 @@ Uptime stats type: integer -Server uptime in seconds +Server uptime in seconds. ==== apache-status.uptime.uptime type: integer -Server uptime +Server uptime. === cpu Fields -CPU stats +CPU stats. @@ -189,40 +189,40 @@ CPU stats type: float -CPU Load +CPU Load. ==== apache-status.cpu.cpuUser type: float -cpu user load +CPU user load. ==== apache-status.cpu.cpuSystem type: float -System cpu +System cpu. ==== apache-status.cpu.cpuChildrenUser type: float -CPU of children user +CPU of children user. ==== apache-status.cpu.cpuChildrenSystem type: float -cpu of children system +CPU of children system. === connections Fields -Connection stats +Connection stats. @@ -230,33 +230,33 @@ Connection stats type: integer -Total connections +Total connections. ==== apache-status.connections.connsAsyncWriting type: integer -Async connectin writing +Async connection writing. ==== apache-status.connections.connsAsyncKeepAlive type: integer -Async keeped alive connetions +Async keeped alive connections. ==== apache-status.connections.connsAsyncClosing type: integer -Async closed connections +Async closed connections. === load Fields -Load averages +Load averages. @@ -264,26 +264,26 @@ Load averages type: float -Load average for the last minute +Load average for the last minute. ==== apache-status.load.load5 type: float -Load avarage for the last 5 minutes +Load average for the last 5 minutes. ==== apache-status.load.load15 type: float -Load aferage for the last 15 minutes +Load average for the last 15 minutes. === scoreboard Fields -Scoreboard metrics +Scoreboard metrics. @@ -291,42 +291,42 @@ Scoreboard metrics type: integer -Starting up +Starting up. ==== apache-status.scoreboard.readingRequest type: integer -Reading requests +Reading requests. ==== apache-status.scoreboard.sendingReply type: integer -Sending Reply +Sending Reply. ==== apache-status.scoreboard.keepalive type: integer -Keep alive +Keep alive. ==== apache-status.scoreboard.dnsLookup type: integer -Dns Lookups +Dns Lookups. ==== apache-status.scoreboard.closingConnection type: integer -Closing connections +Closing connections. ==== apache-status.scoreboard.logging @@ -340,7 +340,7 @@ Logging type: integer -Gracefully finishing +Gracefully finishing. ==== apache-status.scoreboard.idleCleanup @@ -354,21 +354,21 @@ Idle cleanups type: integer -Open slots +Open slots. ==== apache-status.scoreboard.waitingForConnection type: integer -Waiting for connections +Waiting for connections. ==== apache-status.scoreboard.total type: integer -Total +Total. [[exported-fields-redis]] @@ -525,6 +525,88 @@ System status metrics, like CPU and memory usage, that are collected from the op +=== system-cores Fields + +`system-cores` contains local cpu core stats. + + + +==== system-cores.core + +type: integer + +CPU Core number. + + +==== system-cores.user + +type: integer + +The amount of CPU time spent in user space. + + +==== system-cores.user_p + +type: float + +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%. + + +==== system-cores.nice + +type: integer + +The amount of CPU time spent on low-priority processes. + + +==== system-cores.system + +type: integer + +The amount of CPU time spent in kernel space. + + +==== system-cores.system_p + +type: float + +The percentage of CPU time spent in kernel space. + + +==== system-cores.idle + +type: integer + +The amount of CPU time spent idle. + + +==== system-cores.iowait + +type: integer + +The amount of CPU time spent in wait (on disk). + + +==== system-cores.irq + +type: integer + +The amount of CPU time spent servicing and handling hardware interrupts. + + +==== system-cores.softirq + +type: integer + +The amount of CPU time spent servicing and handling software interrupts. + +==== system-cores.steal + +type: integer + +The amount of CPU time spent in involuntary wait by the virtual CPU while the hypervisor was servicing another processor. Available only on Unix. + + === system-cpu Fields `system-cpu` contains local cpu stats. @@ -600,6 +682,33 @@ type: integer The amount of CPU time spent in involuntary wait by the virtual CPU while the hypervisor was servicing another processor. Available only on Unix. +=== load Fields + +Load averages. + + + +==== system-cpu.load.load1 + +type: float + +Load average for the last minute. + + +==== system-cpu.load.load5 + +type: float + +Load average for the last 5 minutes. + + +==== system-cpu.load.load15 + +type: float + +Load average for the last 15 minutes. + + === system-filesystem Fields `system-filesystem` contains local filesystem stats diff --git a/metricbeat/etc/beat.yml b/metricbeat/etc/beat.yml index ca397ce0f8d..50cd33b29df 100644 --- a/metricbeat/etc/beat.yml +++ b/metricbeat/etc/beat.yml @@ -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"] diff --git a/metricbeat/etc/fields.yml b/metricbeat/etc/fields.yml index d2e1d607886..d356f7e902d 100644 --- a/metricbeat/etc/fields.yml +++ b/metricbeat/etc/fields.yml @@ -86,140 +86,140 @@ 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: > @@ -227,7 +227,7 @@ apache: - name: gracefullyFinishing type: integer description: > - Gracefully finishing + Gracefully finishing. - name: idleCleanup type: integer description: > @@ -235,15 +235,15 @@ apache: - 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: > @@ -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: > @@ -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: > diff --git a/metricbeat/include/list.go b/metricbeat/include/list.go index 99df14f7823..a54e318de5a 100644 --- a/metricbeat/include/list.go +++ b/metricbeat/include/list.go @@ -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" diff --git a/metricbeat/metricbeat.template-es2x.json b/metricbeat/metricbeat.template-es2x.json index 4758e7b51b9..45818cea46c 100644 --- a/metricbeat/metricbeat.template-es2x.json +++ b/metricbeat/metricbeat.template-es2x.json @@ -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": { @@ -261,6 +298,19 @@ "irq": { "type": "integer" }, + "load": { + "properties": { + "load1": { + "type": "float" + }, + "load15": { + "type": "float" + }, + "load5": { + "type": "float" + } + } + }, "nice": { "type": "integer" }, diff --git a/metricbeat/metricbeat.template.json b/metricbeat/metricbeat.template.json index 4efdd0e4083..a598a19d2d8 100644 --- a/metricbeat/metricbeat.template.json +++ b/metricbeat/metricbeat.template.json @@ -241,6 +241,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": { @@ -252,6 +289,19 @@ "irq": { "type": "integer" }, + "load": { + "properties": { + "load1": { + "type": "float" + }, + "load15": { + "type": "float" + }, + "load5": { + "type": "float" + } + } + }, "nice": { "type": "integer" }, diff --git a/metricbeat/metricbeat.yml b/metricbeat/metricbeat.yml index ce71d08cca8..0e0edce5a2f 100644 --- a/metricbeat/metricbeat.yml +++ b/metricbeat/metricbeat.yml @@ -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"] diff --git a/metricbeat/module/apache/status/fields.yml b/metricbeat/module/apache/status/fields.yml index f43e1401cb7..6546b49e4c2 100644 --- a/metricbeat/module/apache/status/fields.yml +++ b/metricbeat/module/apache/status/fields.yml @@ -7,140 +7,140 @@ - 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: > @@ -148,7 +148,7 @@ - name: gracefullyFinishing type: integer description: > - Gracefully finishing + Gracefully finishing. - name: idleCleanup type: integer description: > @@ -156,12 +156,12 @@ - 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. diff --git a/metricbeat/module/system/cores/cores.go b/metricbeat/module/system/cores/cores.go new file mode 100644 index 00000000000..eafebb2e9e5 --- /dev/null +++ b/metricbeat/module/system/cores/cores.go @@ -0,0 +1,55 @@ +// +build darwin linux openbsd windows + +package cores + +import ( + "github.com/elastic/beats/libbeat/common" + "github.com/elastic/beats/metricbeat/mb" + "github.com/elastic/beats/topbeat/system" + + "github.com/pkg/errors" +) + +func init() { + if err := mb.Registry.AddMetricSet("system", "cores", New); err != nil { + panic(err) + } +} + +// MetricSet for fetching system core metrics. +type MetricSet struct { + mb.BaseMetricSet + cpu *system.CPU +} + +// New is a mb.MetricSetFactory that returns a cores.MetricSet. +func New(base mb.BaseMetricSet) (mb.MetricSet, error) { + + return &MetricSet{ + BaseMetricSet: base, + cpu: &system.CPU{ + CpuPerCore: true, + }, + }, nil +} + +// Fetch fetches CPU core metrics from the OS. +func (m *MetricSet) Fetch() ([]common.MapStr, error) { + + cpuCoreStat, err := system.GetCpuTimesList() + if err != nil { + return nil, errors.Wrap(err, "cpu core times") + } + m.cpu.AddCpuPercentageList(cpuCoreStat) + + cores := []common.MapStr{} + + for core, stat := range cpuCoreStat { + coreStat := system.GetCpuStatEvent(&stat) + coreStat["core"] = core + cores = append(cores, coreStat) + + } + + return cores, nil +} diff --git a/metricbeat/module/system/cores/doc.go b/metricbeat/module/system/cores/doc.go new file mode 100644 index 00000000000..ef56bd34c19 --- /dev/null +++ b/metricbeat/module/system/cores/doc.go @@ -0,0 +1,4 @@ +/* +Package cores collects cpu core metrics from the host OS. +*/ +package cores diff --git a/metricbeat/module/system/cores/fields.yml b/metricbeat/module/system/cores/fields.yml new file mode 100644 index 00000000000..3c53ecdbcf4 --- /dev/null +++ b/metricbeat/module/system/cores/fields.yml @@ -0,0 +1,63 @@ +- 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. + diff --git a/metricbeat/module/system/cpu/cpu.go b/metricbeat/module/system/cpu/cpu.go index 61ca9902d47..a8549f56b0c 100644 --- a/metricbeat/module/system/cpu/cpu.go +++ b/metricbeat/module/system/cpu/cpu.go @@ -19,19 +19,34 @@ func init() { // MetricSet for fetching system CPU metrics. type MetricSet struct { mb.BaseMetricSet + cpu *system.CPU } // New is a mb.MetricSetFactory that returns a cpu.MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - return &MetricSet{base}, nil + + return &MetricSet{ + BaseMetricSet: base, + cpu: &system.CPU{}, + }, nil } // Fetch fetches CPU metrics from the OS. func (m *MetricSet) Fetch() (common.MapStr, error) { + cpuStat, err := system.GetCpuTimes() if err != nil { return nil, errors.Wrap(err, "cpu times") } + m.cpu.AddCpuPercentage(cpuStat) + + loadStat, err := system.GetSystemLoad() + if err != nil { + return nil, errors.Wrap(err, "load statistics") + } + + event := system.GetCpuStatEvent(cpuStat) + event["load"] = loadStat - return system.GetCpuStatEvent(cpuStat), nil + return event, nil } diff --git a/metricbeat/module/system/cpu/fields.yml b/metricbeat/module/system/cpu/fields.yml index ad62414f833..e375c7f56b3 100644 --- a/metricbeat/module/system/cpu/fields.yml +++ b/metricbeat/module/system/cpu/fields.yml @@ -56,3 +56,20 @@ 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. diff --git a/metricbeat/tests/system/test_system.py b/metricbeat/tests/system/test_system.py index c490f28f548..2f0d492721c 100644 --- a/metricbeat/tests/system/test_system.py +++ b/metricbeat/tests/system/test_system.py @@ -3,9 +3,12 @@ import unittest import metricbeat -SYSTEM_CPU_FIELDS = ["idle", "iowait", "irq", "nice", "softirq", +SYSTEM_CPU_FIELDS = ["idle", "iowait", "irq", "load", "nice", "softirq", "steal", "system", "system_p", "user", "user_p"] +SYSTEM_CORES = ["core", "idle", "iowait", "irq", "nice", "softirq", + "steal", "system", "system_p", "user", "user_p"] + SYSTEM_FILESYSTEM_FIELDS = ["avail", "device_name", "files", "free", "free_files", "mount_point", "total", "used", "used_p"] @@ -45,6 +48,31 @@ def test_cpu(self): cpu = evt["system-cpu"] self.assertItemsEqual(SYSTEM_CPU_FIELDS, cpu.keys()) + def test_cores(self): + """ + Test cores system output. + """ + self.render_config_template(modules=[{ + "name": "system", + "metricsets": ["cores"], + "period": "5s" + }]) + proc = self.start_beat() + self.wait_until(lambda: self.output_lines() > 0) + proc.check_kill_and_wait() + + # Ensure no errors or warnings exist in the log. + log = self.get_log() + self.assertNotRegexpMatches(log, "ERR|WARN") + + output = self.read_output_json() + self.assertGreater(len(output), 0) + + for evt in output: + self.assert_fields_are_documented(evt) + cores = evt["system-cores"] + self.assertItemsEqual(SYSTEM_CORES, cores.keys()) + def test_filesystem(self): """ Test system/filesystem output. diff --git a/topbeat/system/cpu.go b/topbeat/system/cpu.go index bce471569c5..f5a4f44b21c 100644 --- a/topbeat/system/cpu.go +++ b/topbeat/system/cpu.go @@ -10,8 +10,7 @@ import ( ) type CPU struct { - CpuPerCore bool - + CpuPerCore bool LastCpuTimes *CpuTimes LastCpuTimesList []CpuTimes } @@ -31,7 +30,6 @@ func GetCpuTimes() (*CpuTimes, error) { } return &CpuTimes{Cpu: cpu}, nil - } func GetCpuTimesList() ([]CpuTimes, error) {