Revert "Add build constraint for linux collectors."

This commit is contained in:
Siavash Safi 2015-05-12 15:36:41 +04:30
parent 4c5db2787e
commit d7ec7eac1f
11 changed files with 13 additions and 13 deletions

View file

@ -1,4 +1,4 @@
// +build linux,!nobonding // +build !nobonding
package collector package collector

View file

@ -1,4 +1,4 @@
// +build linux,!nodiskstats // +build !nodiskstats
package collector package collector

View file

@ -1,4 +1,4 @@
// +build linux,!nofilesystem // +build !nofilesystem
package collector package collector

View file

@ -1,4 +1,4 @@
// +build linux,!nointerrupts // +build !nointerrupts
package collector package collector

View file

@ -1,4 +1,4 @@
// +build linux,!nolastlogin // +build !nolastlogin
package collector package collector

View file

@ -1,4 +1,4 @@
// +build linux,!nomegacli // +build !nomegacli
package collector package collector

View file

@ -1,4 +1,4 @@
// +build linux,!nomeminfo // +build !nomeminfo
package collector package collector

View file

@ -1,4 +1,4 @@
// +build linux,!nonetdev // +build !nonetdev
package collector package collector

View file

@ -1,4 +1,4 @@
// +build linux,!nonetstat // +build !nonetstat
package collector package collector

View file

@ -1,4 +1,4 @@
// +build linux,!nostat // +build !nostat
package collector 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. // Only some of these may be present, depending on kernel version.
cpuFields := []string{"user", "nice", "system", "idle", "iowait", "irq", "softirq", "steal", "guest"} cpuFields := []string{"user", "nice", "system", "idle", "iowait", "irq", "softirq", "steal", "guest"}
// OpenVZ guests lack the "guest" CPU field, which needs to be ignored. // OpenVZ guests lack the "guest" CPU field, which needs to be ignored.
expectedFieldNum := len(cpuFields) + 1 expectedFieldNum := len(cpuFields)+1
if expectedFieldNum > len(parts) { if expectedFieldNum > len(parts) {
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) value, err := strconv.ParseFloat(v, 64)
if err != nil { if err != nil {
return err return err

View file

@ -1,4 +1,4 @@
// +build linux,!notcpstat // +build !notcpstat
package collector package collector