Skip to content

Commit d05aac4

Browse files
committed
Fix capitalization of CPU acronym throughout
Signed-off-by: Julius Volz <[email protected]>
1 parent f07e982 commit d05aac4

8 files changed

+38
-38
lines changed

collector/cpu_common.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const (
2626
var (
2727
nodeCPUSecondsDesc = prometheus.NewDesc(
2828
prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "seconds_total"),
29-
"Seconds the cpus spent in each mode.",
29+
"Seconds the CPUs spent in each mode.",
3030
[]string{"cpu", "mode"}, nil,
3131
)
3232
)

collector/cpu_dragonfly.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func NewStatCollector(logger log.Logger) (Collector, error) {
9393
}
9494

9595
func getDragonFlyCPUTimes() ([]float64, error) {
96-
// We want time spent per-cpu per CPUSTATE.
96+
// We want time spent per-CPU per CPUSTATE.
9797
// CPUSTATES (number of CPUSTATES) is defined as 5U.
9898
// States: CP_USER | CP_NICE | CP_SYS | CP_IDLE | CP_INTR
9999
//

collector/cpu_linux.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,17 @@ func NewCPUCollector(logger log.Logger) (Collector, error) {
8282
),
8383
cpuGuest: prometheus.NewDesc(
8484
prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "guest_seconds_total"),
85-
"Seconds the cpus spent in guests (VMs) for each mode.",
85+
"Seconds the CPUs spent in guests (VMs) for each mode.",
8686
[]string{"cpu", "mode"}, nil,
8787
),
8888
cpuCoreThrottle: prometheus.NewDesc(
8989
prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "core_throttles_total"),
90-
"Number of times this cpu core has been throttled.",
90+
"Number of times this CPU core has been throttled.",
9191
[]string{"package", "core"}, nil,
9292
),
9393
cpuPackageThrottle: prometheus.NewDesc(
9494
prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "package_throttles_total"),
95-
"Number of times this cpu package has been throttled.",
95+
"Number of times this CPU package has been throttled.",
9696
[]string{"package"}, nil,
9797
),
9898
logger: logger,
@@ -224,7 +224,7 @@ func (c *cpuCollector) updateThermalThrottle(ch chan<- prometheus.Metric) error
224224
// metric node_cpu_core_throttles_total
225225
//
226226
// We process this metric before the package throttles as there
227-
// are cpu+kernel combinations that only present core throttles
227+
// are CPU+kernel combinations that only present core throttles
228228
// but no package throttles.
229229
// Seen e.g. on an Intel Xeon E5472 system with RHEL 6.9 kernel.
230230
if _, present := packageCoreThrottles[physicalPackageID]; !present {
@@ -269,7 +269,7 @@ func (c *cpuCollector) updateThermalThrottle(ch chan<- prometheus.Metric) error
269269
return nil
270270
}
271271

272-
// updateStat reads /proc/stat through procfs and exports cpu related metrics.
272+
// updateStat reads /proc/stat through procfs and exports CPU-related metrics.
273273
func (c *cpuCollector) updateStat(ch chan<- prometheus.Metric) error {
274274
stats, err := c.fs.Stat()
275275
if err != nil {

collector/cpufreq_linux.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ func NewCPUFreqCollector(logger log.Logger) (Collector, error) {
6464
),
6565
scalingFreq: prometheus.NewDesc(
6666
prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_hertz"),
67-
"Current scaled cpu thread frequency in hertz.",
67+
"Current scaled CPU thread frequency in hertz.",
6868
[]string{"cpu"}, nil,
6969
),
7070
scalingFreqMin: prometheus.NewDesc(
7171
prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_min_hertz"),
72-
"Minimum scaled cpu thread frequency in hertz.",
72+
"Minimum scaled CPU thread frequency in hertz.",
7373
[]string{"cpu"}, nil,
7474
),
7575
scalingFreqMax: prometheus.NewDesc(
7676
prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_max_hertz"),
77-
"Maximum scaled cpu thread frequency in hertz.",
77+
"Maximum scaled CPU thread frequency in hertz.",
7878
[]string{"cpu"}, nil,
7979
),
8080
logger: logger,

collector/cpufreq_solaris.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ func NewCpuFreqCollector(logger log.Logger) (Collector, error) {
4242
return &cpuFreqCollector{
4343
cpuFreq: prometheus.NewDesc(
4444
prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_hertz"),
45-
"Current cpu thread frequency in hertz.",
45+
"Current CPU thread frequency in hertz.",
4646
[]string{"cpu"}, nil,
4747
),
4848
cpuFreqMax: prometheus.NewDesc(
4949
prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_max_hertz"),
50-
"Maximum cpu thread frequency in hertz.",
50+
"Maximum CPU thread frequency in hertz.",
5151
[]string{"cpu"}, nil,
5252
),
5353
logger: logger,

collector/fixtures/e2e-64k-page-output.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ node_cpu_bug_info{bug="cpu_meltdown"} 1
190190
node_cpu_bug_info{bug="mds"} 1
191191
node_cpu_bug_info{bug="spectre_v1"} 1
192192
node_cpu_bug_info{bug="spectre_v2"} 1
193-
# HELP node_cpu_core_throttles_total Number of times this cpu core has been throttled.
193+
# HELP node_cpu_core_throttles_total Number of times this CPU core has been throttled.
194194
# TYPE node_cpu_core_throttles_total counter
195195
node_cpu_core_throttles_total{core="0",package="0"} 5
196196
node_cpu_core_throttles_total{core="0",package="1"} 0
@@ -202,7 +202,7 @@ node_cpu_flag_info{flag="aes"} 1
202202
node_cpu_flag_info{flag="avx"} 1
203203
node_cpu_flag_info{flag="avx2"} 1
204204
node_cpu_flag_info{flag="constant_tsc"} 1
205-
# HELP node_cpu_guest_seconds_total Seconds the cpus spent in guests (VMs) for each mode.
205+
# HELP node_cpu_guest_seconds_total Seconds the CPUs spent in guests (VMs) for each mode.
206206
# TYPE node_cpu_guest_seconds_total counter
207207
node_cpu_guest_seconds_total{cpu="0",mode="nice"} 0.01
208208
node_cpu_guest_seconds_total{cpu="0",mode="user"} 0.02
@@ -230,29 +230,29 @@ node_cpu_info{cachesize="8192 KB",core="2",cpu="2",family="6",microcode="0xb4",m
230230
node_cpu_info{cachesize="8192 KB",core="2",cpu="6",family="6",microcode="0xb4",model="142",model_name="Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz",package="0",stepping="10",vendor="GenuineIntel"} 1
231231
node_cpu_info{cachesize="8192 KB",core="3",cpu="3",family="6",microcode="0xb4",model="142",model_name="Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz",package="0",stepping="10",vendor="GenuineIntel"} 1
232232
node_cpu_info{cachesize="8192 KB",core="3",cpu="7",family="6",microcode="0xb4",model="142",model_name="Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz",package="0",stepping="10",vendor="GenuineIntel"} 1
233-
# HELP node_cpu_package_throttles_total Number of times this cpu package has been throttled.
233+
# HELP node_cpu_package_throttles_total Number of times this CPU package has been throttled.
234234
# TYPE node_cpu_package_throttles_total counter
235235
node_cpu_package_throttles_total{package="0"} 30
236236
node_cpu_package_throttles_total{package="1"} 6
237-
# HELP node_cpu_scaling_frequency_hertz Current scaled cpu thread frequency in hertz.
237+
# HELP node_cpu_scaling_frequency_hertz Current scaled CPU thread frequency in hertz.
238238
# TYPE node_cpu_scaling_frequency_hertz gauge
239239
node_cpu_scaling_frequency_hertz{cpu="0"} 1.699981e+09
240240
node_cpu_scaling_frequency_hertz{cpu="1"} 1.699981e+09
241241
node_cpu_scaling_frequency_hertz{cpu="2"} 8e+06
242242
node_cpu_scaling_frequency_hertz{cpu="3"} 8e+06
243-
# HELP node_cpu_scaling_frequency_max_hertz Maximum scaled cpu thread frequency in hertz.
243+
# HELP node_cpu_scaling_frequency_max_hertz Maximum scaled CPU thread frequency in hertz.
244244
# TYPE node_cpu_scaling_frequency_max_hertz gauge
245245
node_cpu_scaling_frequency_max_hertz{cpu="0"} 3.7e+09
246246
node_cpu_scaling_frequency_max_hertz{cpu="1"} 3.7e+09
247247
node_cpu_scaling_frequency_max_hertz{cpu="2"} 4.2e+09
248248
node_cpu_scaling_frequency_max_hertz{cpu="3"} 4.2e+09
249-
# HELP node_cpu_scaling_frequency_min_hertz Minimum scaled cpu thread frequency in hertz.
249+
# HELP node_cpu_scaling_frequency_min_hertz Minimum scaled CPU thread frequency in hertz.
250250
# TYPE node_cpu_scaling_frequency_min_hertz gauge
251251
node_cpu_scaling_frequency_min_hertz{cpu="0"} 8e+08
252252
node_cpu_scaling_frequency_min_hertz{cpu="1"} 8e+08
253253
node_cpu_scaling_frequency_min_hertz{cpu="2"} 1e+06
254254
node_cpu_scaling_frequency_min_hertz{cpu="3"} 1e+06
255-
# HELP node_cpu_seconds_total Seconds the cpus spent in each mode.
255+
# HELP node_cpu_seconds_total Seconds the CPUs spent in each mode.
256256
# TYPE node_cpu_seconds_total counter
257257
node_cpu_seconds_total{cpu="0",mode="idle"} 10870.69
258258
node_cpu_seconds_total{cpu="0",mode="iowait"} 2.2

collector/fixtures/e2e-output.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ node_cpu_bug_info{bug="cpu_meltdown"} 1
253253
node_cpu_bug_info{bug="mds"} 1
254254
node_cpu_bug_info{bug="spectre_v1"} 1
255255
node_cpu_bug_info{bug="spectre_v2"} 1
256-
# HELP node_cpu_core_throttles_total Number of times this cpu core has been throttled.
256+
# HELP node_cpu_core_throttles_total Number of times this CPU core has been throttled.
257257
# TYPE node_cpu_core_throttles_total counter
258258
node_cpu_core_throttles_total{core="0",package="0"} 5
259259
node_cpu_core_throttles_total{core="0",package="1"} 0
@@ -265,7 +265,7 @@ node_cpu_flag_info{flag="aes"} 1
265265
node_cpu_flag_info{flag="avx"} 1
266266
node_cpu_flag_info{flag="avx2"} 1
267267
node_cpu_flag_info{flag="constant_tsc"} 1
268-
# HELP node_cpu_guest_seconds_total Seconds the cpus spent in guests (VMs) for each mode.
268+
# HELP node_cpu_guest_seconds_total Seconds the CPUs spent in guests (VMs) for each mode.
269269
# TYPE node_cpu_guest_seconds_total counter
270270
node_cpu_guest_seconds_total{cpu="0",mode="nice"} 0.01
271271
node_cpu_guest_seconds_total{cpu="0",mode="user"} 0.02
@@ -293,29 +293,29 @@ node_cpu_info{cachesize="8192 KB",core="2",cpu="2",family="6",microcode="0xb4",m
293293
node_cpu_info{cachesize="8192 KB",core="2",cpu="6",family="6",microcode="0xb4",model="142",model_name="Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz",package="0",stepping="10",vendor="GenuineIntel"} 1
294294
node_cpu_info{cachesize="8192 KB",core="3",cpu="3",family="6",microcode="0xb4",model="142",model_name="Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz",package="0",stepping="10",vendor="GenuineIntel"} 1
295295
node_cpu_info{cachesize="8192 KB",core="3",cpu="7",family="6",microcode="0xb4",model="142",model_name="Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz",package="0",stepping="10",vendor="GenuineIntel"} 1
296-
# HELP node_cpu_package_throttles_total Number of times this cpu package has been throttled.
296+
# HELP node_cpu_package_throttles_total Number of times this CPU package has been throttled.
297297
# TYPE node_cpu_package_throttles_total counter
298298
node_cpu_package_throttles_total{package="0"} 30
299299
node_cpu_package_throttles_total{package="1"} 6
300-
# HELP node_cpu_scaling_frequency_hertz Current scaled cpu thread frequency in hertz.
300+
# HELP node_cpu_scaling_frequency_hertz Current scaled CPU thread frequency in hertz.
301301
# TYPE node_cpu_scaling_frequency_hertz gauge
302302
node_cpu_scaling_frequency_hertz{cpu="0"} 1.699981e+09
303303
node_cpu_scaling_frequency_hertz{cpu="1"} 1.699981e+09
304304
node_cpu_scaling_frequency_hertz{cpu="2"} 8e+06
305305
node_cpu_scaling_frequency_hertz{cpu="3"} 8e+06
306-
# HELP node_cpu_scaling_frequency_max_hertz Maximum scaled cpu thread frequency in hertz.
306+
# HELP node_cpu_scaling_frequency_max_hertz Maximum scaled CPU thread frequency in hertz.
307307
# TYPE node_cpu_scaling_frequency_max_hertz gauge
308308
node_cpu_scaling_frequency_max_hertz{cpu="0"} 3.7e+09
309309
node_cpu_scaling_frequency_max_hertz{cpu="1"} 3.7e+09
310310
node_cpu_scaling_frequency_max_hertz{cpu="2"} 4.2e+09
311311
node_cpu_scaling_frequency_max_hertz{cpu="3"} 4.2e+09
312-
# HELP node_cpu_scaling_frequency_min_hertz Minimum scaled cpu thread frequency in hertz.
312+
# HELP node_cpu_scaling_frequency_min_hertz Minimum scaled CPU thread frequency in hertz.
313313
# TYPE node_cpu_scaling_frequency_min_hertz gauge
314314
node_cpu_scaling_frequency_min_hertz{cpu="0"} 8e+08
315315
node_cpu_scaling_frequency_min_hertz{cpu="1"} 8e+08
316316
node_cpu_scaling_frequency_min_hertz{cpu="2"} 1e+06
317317
node_cpu_scaling_frequency_min_hertz{cpu="3"} 1e+06
318-
# HELP node_cpu_seconds_total Seconds the cpus spent in each mode.
318+
# HELP node_cpu_seconds_total Seconds the CPUs spent in each mode.
319319
# TYPE node_cpu_seconds_total counter
320320
node_cpu_seconds_total{cpu="0",mode="idle"} 10870.69
321321
node_cpu_seconds_total{cpu="0",mode="iowait"} 2.2

collector/perf_linux_test.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -67,29 +67,29 @@ func TestPerfCollectorStride(t *testing.T) {
6767
tests := []struct {
6868
name string
6969
flag string
70-
exCpus []int
70+
exCPUs []int
7171
}{
7272
{
73-
name: "valid single cpu",
73+
name: "valid single CPU",
7474
flag: "1",
75-
exCpus: []int{1},
75+
exCPUs: []int{1},
7676
},
7777
{
78-
name: "valid range cpus",
78+
name: "valid range CPUs",
7979
flag: "1-5",
80-
exCpus: []int{1, 2, 3, 4, 5},
80+
exCPUs: []int{1, 2, 3, 4, 5},
8181
},
8282
{
8383
name: "valid stride",
8484
flag: "1-8:2",
85-
exCpus: []int{1, 3, 5, 7},
85+
exCPUs: []int{1, 3, 5, 7},
8686
},
8787
}
8888

8989
for _, test := range tests {
9090
t.Run(test.name, func(t *testing.T) {
9191
ncpu := runtime.NumCPU()
92-
for _, cpu := range test.exCpus {
92+
for _, cpu := range test.exCPUs {
9393
if cpu > ncpu {
9494
t.Skipf("Skipping test because runtime.NumCPU < %d", cpu)
9595
}
@@ -101,7 +101,7 @@ func TestPerfCollectorStride(t *testing.T) {
101101
}
102102

103103
c := collector.(*perfCollector)
104-
for _, cpu := range test.exCpus {
104+
for _, cpu := range test.exCPUs {
105105
if _, ok := c.perfHwProfilers[cpu]; !ok {
106106
t.Fatalf("Expected CPU %v in hardware profilers", cpu)
107107
}
@@ -124,12 +124,12 @@ func TestPerfCPUFlagToCPUs(t *testing.T) {
124124
errStr string
125125
}{
126126
{
127-
name: "valid single cpu",
127+
name: "valid single CPU",
128128
flag: "1",
129129
exCpus: []int{1},
130130
},
131131
{
132-
name: "valid range cpus",
132+
name: "valid range CPUs",
133133
flag: "1-5",
134134
exCpus: []int{1, 2, 3, 4, 5},
135135
},
@@ -171,15 +171,15 @@ func TestPerfCPUFlagToCPUs(t *testing.T) {
171171
}
172172
if len(cpus) != len(test.exCpus) {
173173
t.Fatalf(
174-
"expected cpus %v, got %v",
174+
"expected CPUs %v, got %v",
175175
test.exCpus,
176176
cpus,
177177
)
178178
}
179179
for i := range cpus {
180180
if test.exCpus[i] != cpus[i] {
181181
t.Fatalf(
182-
"expected cpus %v, got %v",
182+
"expected CPUs %v, got %v",
183183
test.exCpus[i],
184184
cpus[i],
185185
)

0 commit comments

Comments
 (0)