generic

package
v0.18.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: BSD-3-Clause Imports: 21 Imported by: 0

README

PSUC

Uses psutils to collect certain system metrics cross-platform

Documentation

Index

Constants

View Source
const (
	GENERIC_PREFIX = "generic/"
	LOG_PREFIX     = "builtins.generic."
	CPU_NAME       = "cpu"
	DISK_NAME      = "disk"
	FS_NAME        = "fs"
	LOAD_NAME      = "load"
	VM_NAME        = "vm"
	IF_NAME        = "if"
	PROTO_NAME     = "proto"
)

Variables

This section is empty.

Functions

func New

func New() ([]collector.Collector, error)

New creates new PSUtil collector

func NewCPUCollector

func NewCPUCollector(cfgBaseName string) (collector.Collector, error)

NewCPUCollector creates new psutils cpu collector

func NewDiskCollector

func NewDiskCollector(cfgBaseName string) (collector.Collector, error)

NewDiskCollector creates new psutils disk collector

func NewFSCollector

func NewFSCollector(cfgBaseName string) (collector.Collector, error)

NewFSCollector creates new psutils disk collector

func NewLoadCollector

func NewLoadCollector(cfgBaseName string) (collector.Collector, error)

NewLoadCollector creates new psutils collector

func NewNetIFCollector

func NewNetIFCollector(cfgBaseName string) (collector.Collector, error)

NewNetIFCollector creates new psutils collector

func NewNetProtoCollector

func NewNetProtoCollector(cfgBaseName string) (collector.Collector, error)

NewNetProtoCollector creates new psutils collector

func NewVMCollector

func NewVMCollector(cfgBaseName string) (collector.Collector, error)

NewVMCollector creates new psutils collector

Types

type CPU

type CPU struct {
	// contains filtered or unexported fields
}

CPU metrics from psutils

func (*CPU) Collect

func (c *CPU) Collect() error

Collect cpu metrics

func (*CPU) Flush

func (c *CPU) Flush() cgm.Metrics

Flush returns last metrics collected

func (*CPU) ID

func (c *CPU) ID() string

ID returns the id of the instance

func (*CPU) Inventory

func (c *CPU) Inventory() collector.InventoryStats

Inventory returns collector stats for /inventory endpoint

type Disk

type Disk struct {
	// contains filtered or unexported fields
}

Disk metrics from the Linux ProcFS

func (*Disk) Collect

func (c *Disk) Collect() error

Collect disk device metrics

func (*Disk) Flush

func (c *Disk) Flush() cgm.Metrics

Flush returns last metrics collected

func (*Disk) ID

func (c *Disk) ID() string

ID returns the id of the instance

func (*Disk) Inventory

func (c *Disk) Inventory() collector.InventoryStats

Inventory returns collector stats for /inventory endpoint

type DiskOptions

type DiskOptions struct {
	// common
	ID                   string   `json:"id" toml:"id" yaml:"id"`
	MetricsEnabled       []string `json:"metrics_enabled" toml:"metrics_enabled" yaml:"metrics_enabled"`
	MetricsDisabled      []string `json:"metrics_disabled" toml:"metrics_disabled" yaml:"metrics_disabled"`
	MetricsDefaultStatus string   `json:"metrics_default_status" toml:"metrics_default_status" toml:"metrics_default_status"`
	RunTTL               string   `json:"run_ttl" toml:"run_ttl" yaml:"run_ttl"`

	// collector specific
	IODevices []string `json:"io_devices" toml:"io_devices" yaml:"io_devices"`
}

DiskOptions defines what elements can be overridden in a config file

type FS

type FS struct {
	// contains filtered or unexported fields
}

FS metrics from the Linux ProcFS

func (*FS) Collect

func (c *FS) Collect() error

Collect disk fs metrics

func (*FS) Flush

func (c *FS) Flush() cgm.Metrics

Flush returns last metrics collected

func (*FS) ID

func (c *FS) ID() string

ID returns the id of the instance

func (*FS) Inventory

func (c *FS) Inventory() collector.InventoryStats

Inventory returns collector stats for /inventory endpoint

type IF

type IF struct {
	// contains filtered or unexported fields
}

IF metrics

func (*IF) Collect

func (c *IF) Collect() error

Collect metrics

func (*IF) Flush

func (c *IF) Flush() cgm.Metrics

Flush returns last metrics collected

func (*IF) ID

func (c *IF) ID() string

ID returns the id of the instance

func (*IF) Inventory

func (c *IF) Inventory() collector.InventoryStats

Inventory returns collector stats for /inventory endpoint

type Load

type Load struct {
	// contains filtered or unexported fields
}

Load metrics

func (*Load) Collect

func (c *Load) Collect() error

Collect load metrics

func (*Load) Flush

func (c *Load) Flush() cgm.Metrics

Flush returns last metrics collected

func (*Load) ID

func (c *Load) ID() string

ID returns the id of the instance

func (*Load) Inventory

func (c *Load) Inventory() collector.InventoryStats

Inventory returns collector stats for /inventory endpoint

type Proto

type Proto struct {
	// contains filtered or unexported fields
}

Proto metrics

func (*Proto) Collect

func (c *Proto) Collect() error

Collect metrics

func (*Proto) Flush

func (c *Proto) Flush() cgm.Metrics

Flush returns last metrics collected

func (*Proto) ID

func (c *Proto) ID() string

ID returns the id of the instance

func (*Proto) Inventory

func (c *Proto) Inventory() collector.InventoryStats

Inventory returns collector stats for /inventory endpoint

type VM

type VM struct {
	// contains filtered or unexported fields
}

VM metrics

func (*VM) Collect

func (c *VM) Collect() error

Collect memory metrics

func (*VM) Flush

func (c *VM) Flush() cgm.Metrics

Flush returns last metrics collected

func (*VM) ID

func (c *VM) ID() string

ID returns the id of the instance

func (*VM) Inventory

func (c *VM) Inventory() collector.InventoryStats

Inventory returns collector stats for /inventory endpoint

Jump to

Keyboard shortcuts

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