mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-09 23:24:09 -08:00
Revert "Add build constraint for linux collectors."
This commit is contained in:
parent
4c5db2787e
commit
d7ec7eac1f
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!nobonding
|
||||
// +build !nobonding
|
||||
|
||||
package collector
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!nodiskstats
|
||||
// +build !nodiskstats
|
||||
|
||||
package collector
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!nofilesystem
|
||||
// +build !nofilesystem
|
||||
|
||||
package collector
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!nointerrupts
|
||||
// +build !nointerrupts
|
||||
|
||||
package collector
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!nolastlogin
|
||||
// +build !nolastlogin
|
||||
|
||||
package collector
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!nomegacli
|
||||
// +build !nomegacli
|
||||
|
||||
package collector
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!nomeminfo
|
||||
// +build !nomeminfo
|
||||
|
||||
package collector
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!nonetdev
|
||||
// +build !nonetdev
|
||||
|
||||
package collector
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!nonetstat
|
||||
// +build !nonetstat
|
||||
|
||||
package collector
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!nostat
|
||||
// +build !nostat
|
||||
|
||||
package collector
|
||||
|
||||
|
@ -98,11 +98,11 @@ func (c *statCollector) Update(ch chan<- prometheus.Metric) (err error) {
|
|||
// Only some of these may be present, depending on kernel version.
|
||||
cpuFields := []string{"user", "nice", "system", "idle", "iowait", "irq", "softirq", "steal", "guest"}
|
||||
// OpenVZ guests lack the "guest" CPU field, which needs to be ignored.
|
||||
expectedFieldNum := len(cpuFields) + 1
|
||||
expectedFieldNum := len(cpuFields)+1
|
||||
if expectedFieldNum > len(parts) {
|
||||
expectedFieldNum = len(parts)
|
||||
}
|
||||
for i, v := range parts[1:expectedFieldNum] {
|
||||
for i, v := range parts[1 : expectedFieldNum] {
|
||||
value, err := strconv.ParseFloat(v, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux,!notcpstat
|
||||
// +build !notcpstat
|
||||
|
||||
package collector
|
||||
|
||||
|
|
Loading…
Reference in a new issue