Skip to content

Commit

Permalink
fix filesystem on other archs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdurham committed Sep 28, 2023
1 parent 302c8c8 commit bc2b7b4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion collector/filesystem_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func NewFilesystemCollector(config *NodeCollectorConfig, logger log.Logger) (Col
}

func (c *filesystemCollector) Update(ch chan<- prometheus.Metric) error {
stats, err := c.GetStats()
stats, err := c.GetStats(c.config.Path)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion collector/filesystem_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
)

// Expose filesystem fullness.
func (c *filesystemCollector) GetStats() ([]filesystemStats, error) {
func (c *filesystemCollector) GetStats(_ PathConfig) ([]filesystemStats, error) {
n, err := unix.Getfsstat(nil, unix.MNT_NOWAIT)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion collector/filesystem_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var stuckMounts = make(map[string]struct{})
var stuckMountsMtx = &sync.Mutex{}

// GetStats returns filesystem stats.
func (c *filesystemCollector) GetStats() ([]filesystemStats, error) {
func (c *filesystemCollector) GetStats(_ PathConfig) ([]filesystemStats, error) {
mps, err := mountPointDetails(c.config, c.logger)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion collector/filesystem_openbsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
)

// Expose filesystem fullness.
func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {
func (c *filesystemCollector) GetStats(_ PathConfig) (stats []filesystemStats, err error) {
var mnt []unix.Statfs_t
size, err := unix.Getfsstat(mnt, unix.MNT_NOWAIT)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion collector/loadavg_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"golang.org/x/sys/unix"
)

func getLoad() ([]float64, error) {
func getLoad(_ *NodeCollectorConfig) ([]float64, error) {
type loadavg struct {
load [3]uint32
scale int
Expand Down
2 changes: 1 addition & 1 deletion collector/loadavg_solaris.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func kstatToFloat(ks *kstat.KStat, kstatKey string) float64 {
return kstatLoadavg
}

func getLoad() ([]float64, error) {
func getLoad(_ *NodeCollectorConfig) ([]float64, error) {
tok, err := kstat.Open()
if err != nil {
panic(err)
Expand Down

0 comments on commit bc2b7b4

Please sign in to comment.