Files
VictoriaMetrics/lib/fs/fs_openbsd.go
JAYICE 696c1aa3e8 lib/fs: introduce new metric for Filesystem type name
This commit introduces a new metric to expose fs type for the provided path.

 For example:
```
vm_fs_info{path="/vmstorage-data", fs_type="xfs"}
```

 Path must be registered with new method `fs.RegisterPathFsMetrics`.

fixes https://github.com/VictoriaMetrics/VictoriaMetrics/issues/10482
2026-05-08 09:17:03 +02:00

25 lines
487 B
Go

package fs
import (
"golang.org/x/sys/unix"
)
type statfs_t = unix.Statfs_t
func freeSpace(stat statfs_t) uint64 {
return uint64(stat.F_bavail) * uint64(stat.F_bsize)
}
// totalSpace returns the total capacity of the filesystem in bytes.
func totalSpace(stat statfs_t) uint64 {
return uint64(stat.F_blocks) * uint64(stat.F_bsize)
}
func statfs(path string, stat *statfs_t) (err error) {
return unix.Statfs(path, stat)
}
func getFsType(path string) string {
return "unknown"
}