mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-01-29 23:00:49 -08:00
Merge pull request #194 from pborzenkov/fix-build-wo-conntrack
Fix build w/o conntrack collector
This commit is contained in:
commit
d955d99e7b
|
@ -16,10 +16,6 @@
|
|||
package collector
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
|
@ -67,15 +63,3 @@ func (c *conntrackCollector) Update(ch chan<- prometheus.Metric) (err error) {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func readUintFromFile(path string) (uint64, error) {
|
||||
data, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
value, err := strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return value, nil
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ package collector
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
@ -29,3 +30,15 @@ func splitToInts(str string, sep string) (ints []int, err error) {
|
|||
}
|
||||
return ints, nil
|
||||
}
|
||||
|
||||
func readUintFromFile(path string) (uint64, error) {
|
||||
data, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
value, err := strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return value, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue