Fix typos, and initialisms from comments in #217

pull/241/head
Sharif Nassar 9 years ago
parent 3fe5e7f8fa
commit bf88b6ee0f

@ -33,7 +33,7 @@ import "C"
const ( const (
defIgnoredMountPoints = "^/(dev)($|/)" defIgnoredMountPoints = "^/(dev)($|/)"
defIgnoredFsTypes = "^devfs$" defIgnoredFSTypes = "^devfs$"
MNT_RDONLY = 0x1 MNT_RDONLY = 0x1
) )
@ -56,7 +56,7 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {
device := C.GoString(&mnt[i].f_mntfromname[0]) device := C.GoString(&mnt[i].f_mntfromname[0])
fstype := C.GoString(&mnt[i].f_fstypename[0]) fstype := C.GoString(&mnt[i].f_fstypename[0])
if c.ignoredFsTypesPattern.MatchString(fstype) { if c.ignoredFSTypesPattern.MatchString(fstype) {
log.Debugf("Ignoring fs type: %s", fstype) log.Debugf("Ignoring fs type: %s", fstype)
continue continue
} }

@ -25,7 +25,7 @@ import (
// Arch-dependent implementation must define: // Arch-dependent implementation must define:
// * defIgnoredMountPoints // * defIgnoredMountPoints
// * defIgnoredFsTypes // * defIgnoredFSTypes
// * filesystemLabelNames // * filesystemLabelNames
// * filesystemCollector.GetStats // * filesystemCollector.GetStats
@ -35,9 +35,9 @@ var (
defIgnoredMountPoints, defIgnoredMountPoints,
"Regexp of mount points to ignore for filesystem collector.") "Regexp of mount points to ignore for filesystem collector.")
ignoredFsTypes = flag.String( ignoredFSTypes = flag.String(
"collector.filesystem.ignored-fs-types", "collector.filesystem.ignored-fs-types",
defIgnoredFsTypes, defIgnoredFSTypes,
"Regexp of filesystem types to ignore for filesystem collector.") "Regexp of filesystem types to ignore for filesystem collector.")
filesystemLabelNames = []string{"device", "mountpoint", "fstype"} filesystemLabelNames = []string{"device", "mountpoint", "fstype"}
@ -45,7 +45,7 @@ var (
type filesystemCollector struct { type filesystemCollector struct {
ignoredMountPointsPattern *regexp.Regexp ignoredMountPointsPattern *regexp.Regexp
ignoredFsTypesPattern *regexp.Regexp ignoredFSTypesPattern *regexp.Regexp
sizeDesc, freeDesc, availDesc, sizeDesc, freeDesc, availDesc,
filesDesc, filesFreeDesc, roDesc *prometheus.Desc filesDesc, filesFreeDesc, roDesc *prometheus.Desc
} }
@ -64,7 +64,7 @@ func init() {
func NewFilesystemCollector() (Collector, error) { func NewFilesystemCollector() (Collector, error) {
subsystem := "filesystem" subsystem := "filesystem"
mountPointPattern := regexp.MustCompile(*ignoredMountPoints) mountPointPattern := regexp.MustCompile(*ignoredMountPoints)
fsTypePatter := regexp.MustCompile(*ignoredFsTypes) FSTypesPattern := regexp.MustCompile(*ignoredFSTypes)
sizeDesc := prometheus.NewDesc( sizeDesc := prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "size"), prometheus.BuildFQName(Namespace, subsystem, "size"),
@ -104,7 +104,7 @@ func NewFilesystemCollector() (Collector, error) {
return &filesystemCollector{ return &filesystemCollector{
ignoredMountPointsPattern: mountPointPattern, ignoredMountPointsPattern: mountPointPattern,
ignoredFsTypesPattern: fsTypesPattern, ignoredFSTypesPattern: FSTypesPattern,
sizeDesc: sizeDesc, sizeDesc: sizeDesc,
freeDesc: freeDesc, freeDesc: freeDesc,
availDesc: availDesc, availDesc: availDesc,

@ -26,7 +26,7 @@ import (
const ( const (
defIgnoredMountPoints = "^/(sys|proc|dev)($|/)" defIgnoredMountPoints = "^/(sys|proc|dev)($|/)"
defIgnoredFsTypes = "^(sys|proc)fs$" defIgnoredFSTypes = "^(sys|proc)fs$"
ST_RDONLY = 0x1 ST_RDONLY = 0x1
) )
@ -48,7 +48,7 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {
log.Debugf("Ignoring mount point: %s", mpd.mountPoint) log.Debugf("Ignoring mount point: %s", mpd.mountPoint)
continue continue
} }
if c.ignoredFsTypesPatter.MatchString(mpd.fsType) { if c.ignoredFSTypesPattern.MatchString(mpd.fsType) {
log.Debugf("Ignoring fs type: %s", mpd.fsType) log.Debugf("Ignoring fs type: %s", mpd.fsType)
continue continue
} }

Loading…
Cancel
Save