filesystem

package
v5.6.8+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2018 License: Apache-2.0 Imports: 9 Imported by: 323

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-25T20:51:36.813Z",
  "beat": {
    "hostname": "host.example.com",
    "name": "host.example.com"
  },
  "metricset": {
    "module": "system",
    "name": "filesystem",
    "rtt": 55
  },
  "system": {
    "filesystem": {
      "avail": 13838553088,
      "device_name": "/dev/disk1",
      "files": 60981246,
      "free": 14100697088,
      "free_files": 3378553,
      "mount_point": "/",
      "total": 249779191808,
      "used": 235678494720,
      "used_p": 0.9435
    }
  },
  "type": "metricsets"
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFileSystemUsedPercentage

func AddFileSystemUsedPercentage(f *FileSystemStat)

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)

func GetFilesystemEvent

func GetFilesystemEvent(fsStat *FileSystemStat) common.MapStr

func New

func New(base mb.BaseMetricSet) (mb.MetricSet, error)

New creates and returns a new instance of MetricSet.

Types

type Config

type Config struct {
	IgnoreTypes []string `config:"filesystem.ignore_types"`
}

type FileSystemStat

type FileSystemStat struct {
	sigar.FileSystemUsage
	DevName     string  `json:"device_name"`
	Mount       string  `json:"mount_point"`
	UsedPercent float64 `json:"used_p"`
	// contains filtered or unexported fields
}

func GetFileSystemStat

func GetFileSystemStat(fs sigar.FileSystem) (*FileSystemStat, error)

type MetricSet

type MetricSet struct {
	mb.BaseMetricSet
	// contains filtered or unexported fields
}

MetricSet for fetching filesystem metrics.

func (*MetricSet) Fetch

func (m *MetricSet) Fetch() ([]common.MapStr, error)

Fetch fetches filesystem metrics for all mounted filesystems and returns an event for each mount point.

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

func BuildTypeFilter(ignoreType ...string) Predicate

BuildTypeFilter returns a predicate that returns false if the given filesystem has a type that matches one of the ignoreType values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL