node_exporter/collector/helper.go
Brian Brazil 25ea90369c Split native collector into it's component parts and make them enablable.
Last login is disabled by default as it's broken on ubuntu 12.04
Interrupts is disabled by default as it's very granular and we'll have total interrupts from /proc/stat

Allow ignoring devices from diskstats, ignore ram and loop devices by default.

Use glog for logging.
2014-06-04 12:37:25 +01:00

19 lines
367 B
Go

package collector
import (
"fmt"
"strconv"
"strings"
)
func splitToInts(str string, sep string) (ints []int, err error) {
for _, part := range strings.Split(str, sep) {
i, err := strconv.Atoi(part)
if err != nil {
return nil, fmt.Errorf("Could not split '%s' because %s is no int: %s", str, part, err)
}
ints = append(ints, i)
}
return ints, nil
}