Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
belimawr committed May 23, 2022
1 parent fd283af commit 38ec0f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions metricbeat/internal/metrics/cpu/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type CPUMetrics struct {
list []CPU

// CPUInfo carries some data from /proc/cpuinfo
CPUinfo []CPUInfo
CPUInfo []CPUInfo
}

// Total returns the total CPU time in ticks as scraped by the API
Expand Down Expand Up @@ -134,8 +134,8 @@ func (m *Monitor) FetchCores() ([]Metrics, error) {
// Only add CPUInfo metric if it's available
// TODO: Remove this if statement once CPUInfo is supported
// by all systems
if len(metric.CPUinfo) != 0 {
coreMetrics[i].cpuInfo = metric.CPUinfo[i]
if len(metric.CPUInfo) != 0 {
coreMetrics[i].cpuInfo = metric.CPUInfo[i]
}
}
m.lastSample = metric
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/internal/metrics/cpu/metrics_procfs_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func Get(procfs resolve.Resolver) (CPUMetrics, error) {
defer cpuInfoFd.Close()

cpuInfo, err := scanCPUInfoFile(bufio.NewScanner(cpuInfoFd))
metrics.CPUinfo = cpuInfo
metrics.CPUInfo = cpuInfo

return metrics, err
}
Expand Down

0 comments on commit 38ec0f5

Please sign in to comment.