diff options
author | Paul Gier <pgier@redhat.com> | 2019-02-05 09:37:27 -0600 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2019-02-05 16:37:27 +0100 |
commit | 2b81bff51843525dc210749c33d96ac382921b1f (patch) | |
tree | bb2b62702671e72b61c141004be4b35c7f7646d5 /collector/meminfo_numa_linux.go | |
parent | dda51ad06a024ea3a75b3399de46c0ce3ebab418 (diff) | |
download | prometheus_node_collector-2b81bff51843525dc210749c33d96ac382921b1f.tar.bz2 prometheus_node_collector-2b81bff51843525dc210749c33d96ac382921b1f.tar.xz prometheus_node_collector-2b81bff51843525dc210749c33d96ac382921b1f.zip |
collector: use path/filepath for handling file paths (#1245)
Similar to #1228. Update the remaining collectors to use
'path/filepath' intead of 'path' for manipulating file paths.
Signed-off-by: Paul Gier <pgier@redhat.com>
Diffstat (limited to 'collector/meminfo_numa_linux.go')
-rw-r--r-- | collector/meminfo_numa_linux.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/collector/meminfo_numa_linux.go b/collector/meminfo_numa_linux.go index b096164..3d121bd 100644 --- a/collector/meminfo_numa_linux.go +++ b/collector/meminfo_numa_linux.go | |||
@@ -20,7 +20,6 @@ import ( | |||
20 | "fmt" | 20 | "fmt" |
21 | "io" | 21 | "io" |
22 | "os" | 22 | "os" |
23 | "path" | ||
24 | "path/filepath" | 23 | "path/filepath" |
25 | "regexp" | 24 | "regexp" |
26 | "strconv" | 25 | "strconv" |
@@ -86,7 +85,7 @@ func getMemInfoNuma() ([]meminfoMetric, error) { | |||
86 | return nil, err | 85 | return nil, err |
87 | } | 86 | } |
88 | for _, node := range nodes { | 87 | for _, node := range nodes { |
89 | meminfoFile, err := os.Open(path.Join(node, "meminfo")) | 88 | meminfoFile, err := os.Open(filepath.Join(node, "meminfo")) |
90 | if err != nil { | 89 | if err != nil { |
91 | return nil, err | 90 | return nil, err |
92 | } | 91 | } |
@@ -98,7 +97,7 @@ func getMemInfoNuma() ([]meminfoMetric, error) { | |||
98 | } | 97 | } |
99 | metrics = append(metrics, numaInfo...) | 98 | metrics = append(metrics, numaInfo...) |
100 | 99 | ||
101 | numastatFile, err := os.Open(path.Join(node, "numastat")) | 100 | numastatFile, err := os.Open(filepath.Join(node, "numastat")) |
102 | if err != nil { | 101 | if err != nil { |
103 | return nil, err | 102 | return nil, err |
104 | } | 103 | } |