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>
This commit is contained in:
parent
dda51ad06a
commit
2b81bff518
5 changed files with 26 additions and 29 deletions
|
|
@ -17,7 +17,7 @@ package collector
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
|
@ -62,7 +62,7 @@ func NewKsmdCollector() (Collector, error) {
|
|||
// Update implements Collector and exposes kernel and system statistics.
|
||||
func (c *ksmdCollector) Update(ch chan<- prometheus.Metric) error {
|
||||
for _, n := range ksmdFiles {
|
||||
val, err := readUintFromFile(sysFilePath(path.Join("kernel/mm/ksm", n)))
|
||||
val, err := readUintFromFile(sysFilePath(filepath.Join("kernel/mm/ksm", n)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue