generic

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: BSD-3-Clause Imports: 25 Imported by: 0

README

PSUC

Uses psutils to collect certain system metrics cross-platform

Documentation

Overview

Package generic provides more cross-platform support for collecting basic system metrics

Index

Constants

View Source
const (
	NamePrefix  = "generic/"
	PackageName = "builtins.generic"
	NameCPU     = "cpu"
	NameDisk    = "disk"
	NameFS      = "fs"
	NameLoad    = "load"
	NameVM      = "vm"
	NameIF      = "if"
	NameProto   = "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, parentLogger zerolog.Logger) (collector.Collector, error)

NewCPUCollector creates new psutils cpu collector

func NewDiskCollector

func NewDiskCollector(cfgBaseName string, parentLogger zerolog.Logger) (collector.Collector, error)

NewDiskCollector creates new psutils disk collector

func NewFSCollector

func NewFSCollector(cfgBaseName string, parentLogger zerolog.Logger) (collector.Collector, error)

NewFSCollector creates new psutils disk collector

func NewLoadCollector

func NewLoadCollector(cfgBaseName string, parentLogger zerolog.Logger) (collector.Collector, error)

NewLoadCollector creates new psutils collector

func NewNetIFCollector

func NewNetIFCollector(cfgBaseName string, parentLogger zerolog.Logger) (collector.Collector, error)

NewNetIFCollector creates new psutils collector

func NewNetProtoCollector

func NewNetProtoCollector(cfgBaseName string, parentLogger zerolog.Logger) (collector.Collector, error)

NewNetProtoCollector creates new psutils collector

func NewVMCollector

func NewVMCollector(cfgBaseName string, parentLogger zerolog.Logger) (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(ctx context.Context) 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

func (*CPU) Logger added in v0.19.1

func (c *CPU) Logger() zerolog.Logger

Logger returns collector's instance of logger

func (*CPU) TTL added in v0.19.4

func (c *CPU) TTL() string

TTL return run TTL if set

type Disk

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

Disk metrics from the Linux ProcFS

func (*Disk) Collect

func (c *Disk) Collect(ctx context.Context) 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

func (*Disk) Logger added in v0.19.1

func (c *Disk) Logger() zerolog.Logger

Logger returns collector's instance of logger

func (*Disk) TTL added in v0.19.4

func (c *Disk) TTL() string

TTL return run TTL if set

type DiskOptions

type DiskOptions struct {
	// common
	ID     string `json:"id" toml:"id" yaml:"id"`
	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(ctx context.Context) 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

func (*FS) Logger added in v0.19.1

func (c *FS) Logger() zerolog.Logger

Logger returns collector's instance of logger

func (*FS) TTL added in v0.19.4

func (c *FS) TTL() string

TTL return run TTL if set

type IF

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

IF metrics

func (*IF) Collect

func (c *IF) Collect(ctx context.Context) 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

func (*IF) Logger added in v0.19.1

func (c *IF) Logger() zerolog.Logger

Logger returns collector's instance of logger

func (*IF) TTL added in v0.19.4

func (c *IF) TTL() string

TTL return run TTL if set

type Load

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

Load metrics

func (*Load) Collect

func (c *Load) Collect(ctx context.Context) 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

func (*Load) Logger added in v0.19.1

func (c *Load) Logger() zerolog.Logger

Logger returns collector's instance of logger

func (*Load) TTL added in v0.19.4

func (c *Load) TTL() string

TTL return run TTL if set

type Proto

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

Proto metrics

func (*Proto) Collect

func (c *Proto) Collect(ctx context.Context) 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

func (*Proto) Logger added in v0.19.1

func (c *Proto) Logger() zerolog.Logger

Logger returns collector's instance of logger

func (*Proto) TTL added in v0.19.4

func (c *Proto) TTL() string

TTL return run TTL if set

type VM

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

VM metrics

func (*VM) Collect

func (c *VM) Collect(ctx context.Context) 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

func (*VM) Logger added in v0.19.1

func (c *VM) Logger() zerolog.Logger

Logger returns collector's instance of logger

func (*VM) TTL added in v0.19.4

func (c *VM) TTL() string

TTL return run TTL if set

Jump to

Keyboard shortcuts

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