fsstat

package
v0.0.0-...-4714720 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2015 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package fsstat implements metrics collection related to filesystem usage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSStat

type FSStat struct {
	FS map[string]*PerFSStat
	// contains filtered or unexported fields
}

FSStat represents file system statistics for all filesystems found on this OS

func New

func New(m *metrics.MetricContext, Step time.Duration) *FSStat

New registers with metriccontext and collects filesystem stats every Step

func (*FSStat) ByUsage

func (s *FSStat) ByUsage() []*PerFSStat

ByUsage returns an slice of *PerDiskStat entries sorted by usage

func (*FSStat) Collect

func (s *FSStat) Collect()

Collect is run every step seconds to parse /etc/mstab and gather inode/disk usage metrics

type PerFSStat

type PerFSStat struct {
	IsMounted bool
	Name      string
	Bsize     *metrics.Gauge
	Blocks    *metrics.Gauge
	Bfree     *metrics.Gauge
	Bavail    *metrics.Gauge
	Files     *metrics.Gauge
	Ffree     *metrics.Gauge
	// Computed stats
	UsagePct     *metrics.Gauge
	FileUsagePct *metrics.Gauge
	// contains filtered or unexported fields
}

PerFSStat represents type for filesystem specific information including associated metrics

func NewPerFSStat

func NewPerFSStat(m *metrics.MetricContext, mp string) *PerFSStat

NewPerFSStat registers with metriccontext for the particular filesystem

func (*PerFSStat) Collect

func (s *PerFSStat) Collect()

Collect calls statfs and populates stats for a particular filesystem

func (*PerFSStat) FileUsage

func (s *PerFSStat) FileUsage() float64

FileUsage returns filesystem files (inodes) usage in percentage

func (*PerFSStat) Unregister

func (s *PerFSStat) Unregister()

Unregister removes metrics from metric-context

func (*PerFSStat) Usage

func (s *PerFSStat) Usage() float64

Usage returns filesystem block usage in percentage

Jump to

Keyboard shortcuts

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