Documentation ¶
Overview ¶
Package filesystem provides a MetricSet implementation that fetches metrics for each of the mounted file systems.
An example event looks as following:
{ "@timestamp": "2016-05-23T08:05:34.853Z", "beat": { "hostname": "host.example.com", "name": "host.example.com" }, "@metadata": { "beat": "noindex", "type": "doc" }, "metricset": { "module": "system", "name": "filesystem", "rtt": 115 }, "system": { "filesystem": { "available": 105569656832, "device_name": "/dev/disk1", "type": "hfs", "files": 4294967279 "free": 105831800832, "free_files": 4292793781, "mount_point": "/", "total": 249779191808, "used": { "bytes": 143947390976, "pct": 0.5763 }, } } }
Index ¶
- func AddFileSystemUsedPercentage(f *FSStat)
- func DefaultIgnoredTypes() (types []string)
- func Filter(in []sigar.FileSystem, p Predicate) []sigar.FileSystem
- func GetFileSystemList() ([]sigar.FileSystem, error)
- func GetFilesystemEvent(fsStat *FSStat) common.MapStr
- func New(base mb.BaseMetricSet) (mb.MetricSet, error)
- type Config
- type FSStat
- type MetricSet
- type Predicate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFileSystemUsedPercentage ¶
func AddFileSystemUsedPercentage(f *FSStat)
AddFileSystemUsedPercentage adds usage data to the filesystem struct
func DefaultIgnoredTypes ¶
func DefaultIgnoredTypes() (types []string)
DefaultIgnoredTypes tries to guess a sane list of filesystem types that could be ignored in the running system
func Filter ¶
func Filter(in []sigar.FileSystem, p Predicate) []sigar.FileSystem
Filter returns a filtered list of filesystems. The in parameter is used as the backing storage for the returned slice and is therefore modified in this operation.
func GetFileSystemList ¶
func GetFileSystemList() ([]sigar.FileSystem, error)
GetFileSystemList retreves overall filesystem stats
func GetFilesystemEvent ¶
GetFilesystemEvent turns a stat struct into a MapStr
Types ¶
type Config ¶
type Config struct {
IgnoreTypes []string `config:"filesystem.ignore_types"`
}
Config stores the metricset-local config
type FSStat ¶
type FSStat struct { sigar.FileSystemUsage DevName string `json:"device_name"` Mount string `json:"mount_point"` UsedPercent float64 `json:"used_p"` SysTypeName string `json:"type"` // contains filtered or unexported fields }
FSStat contains filesystem metrics
func GetFileSystemStat ¶
func GetFileSystemStat(fs sigar.FileSystem) (*FSStat, error)
GetFileSystemStat retreves stats for a single filesystem
type MetricSet ¶
type MetricSet struct { mb.BaseMetricSet // contains filtered or unexported fields }
MetricSet for fetching filesystem metrics.
type Predicate ¶
type Predicate func(*sigar.FileSystem) bool
Predicate is a function predicate for use with filesystems. It returns true if the argument matches the predicate.
func BuildTypeFilter ¶
BuildTypeFilter returns a predicate that returns false if the given filesystem has a type that matches one of the ignoreType values.