readers

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2015 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package readers provides objects that gathers resource data from a host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CpuInfo

type CpuInfo struct {
	Data map[string][]gopsutil_cpu.CPUInfoStat
}

CpuInfo is a reader that scrapes cpu info data. Data source: https://github.com/shirou/gopsutil/tree/master/cpu

func NewCpuInfo

func NewCpuInfo() *CpuInfo

NewCpuInfo is CpuInfo constructor.

func (*CpuInfo) Run

func (c *CpuInfo) Run() error

func (*CpuInfo) ToJson

func (c *CpuInfo) ToJson() ([]byte, error)

type CpuStat

type CpuStat struct {
	Data map[string][]gopsutil_cpu.CPUTimesStat
}

CpuStat is a reader that scrapes cpu stat data. Data source: https://github.com/shirou/gopsutil/tree/master/cpu

func NewCpuStat

func NewCpuStat() *CpuStat

NewCpuStat is CpuStat constructor.

func (*CpuStat) Run

func (c *CpuStat) Run() error

Run gathers gopsutil_cpu.CPUTimes data.

func (*CpuStat) ToJson

func (c *CpuStat) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Df

type Df struct {
	Data    map[string]map[string]interface{}
	FSPaths string
}

Df is a reader that scrapes disk free data and presents it in the form similar to `df`. Data source: https://github.com/cloudfoundry/gosigar/tree/master

func NewDf

func NewDf() *Df

NewDf is Df constructor.

func (*Df) Run

func (d *Df) Run() error

Run gathers df information.

func (*Df) ToJson

func (d *Df) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type DiskIO

type DiskIO struct {
	Data map[string]gopsutil_disk.DiskIOCountersStat
}

DiskIO is a reader that gathers disk io data. Data source: https://github.com/shirou/gopsutil/tree/master/disk

func NewDiskIO

func NewDiskIO() *DiskIO

NewDiskIO is DiskIO constructor.

func (*DiskIO) Run

func (d *DiskIO) Run() error

Run gathers disk IO information from gopsutil.

func (*DiskIO) ToJson

func (d *DiskIO) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type DiskPartitions

type DiskPartitions struct {
	Data map[string]map[string]gopsutil_disk.DiskPartitionStat
}

DiskPartitions is a reader that gathers partition data. Data source: https://github.com/shirou/gopsutil/tree/master/disk

func NewDiskPartitions

func NewDiskPartitions() *DiskPartitions

NewDiskPartitions is DiskPartitions constructor.

func (*DiskPartitions) Run

func (d *DiskPartitions) Run() error

Run gathers partition information from gopsutil.

func (*DiskPartitions) ToJson

func (d *DiskPartitions) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Du

type Du struct {
	Data    map[string]map[string]interface{}
	FSPaths string
}

Df is a reader that scrapes disk usage data and presents it in the form similar to `du`. Data sources: * https://github.com/cloudfoundry/gosigar/tree/master * https://github.com/shirou/gopsutil/tree/master/disk

func NewDu

func NewDu() *Du

func (*Du) Run

func (d *Du) Run() error

Run gathers du information.

func (*Du) ToJson

func (d *Du) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Free

type Free struct {
	Data map[string]map[string]interface{}
}

Free is a reader that scrapes memory data and presents it in the form similar to `free`. Data source: https://github.com/cloudfoundry/gosigar/tree/master

func NewFree

func NewFree() *Free

func (*Free) Run

func (m *Free) Run() error

Run gathers free data from gosigar.

func (*Free) ToJson

func (m *Free) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type HostInfo

type HostInfo struct {
	Data map[string]interface{}
}

func NewHostInfo

func NewHostInfo() *HostInfo

func (*HostInfo) Run

func (h *HostInfo) Run() error

Run gathers host information from gopsutil.

func (*HostInfo) ToJson

func (h *HostInfo) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type HostUsers

type HostUsers struct {
	Data map[string]gopsutil_host.UserStat
}

func NewHostUsers

func NewHostUsers() *HostUsers

func (*HostUsers) Run

func (h *HostUsers) Run() error

Run gathers user information from gopsutil.

func (*HostUsers) ToJson

func (h *HostUsers) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type IReader

type IReader interface {
	Run() error
	ToJson() ([]byte, error)
}

IReader is generic interface for all readers.

func NewGoStruct

func NewGoStruct(name string) (IReader, error)

NewGoStruct instantiates IReader

func NewGoStructByConfig

func NewGoStructByConfig(config resourced_config.Config) (IReader, error)

NewGoStructByConfig instantiates IReader given Config struct

type LoadAvg

type LoadAvg struct {
	Data map[string]interface{}
}

func NewLoadAvg

func NewLoadAvg() *LoadAvg

func (*LoadAvg) Run

func (l *LoadAvg) Run() error

Run gathers load average information from gosigar.

func (*LoadAvg) ToJson

func (l *LoadAvg) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type NetIO

type NetIO struct {
	Data map[string]gopsutil_net.NetIOCountersStat
}

func NewNetIO

func NewNetIO() *NetIO

func (*NetIO) Run

func (n *NetIO) Run() error

Run gathers network IO data from gopsutil.

func (*NetIO) ToJson

func (n *NetIO) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type NetInterfaces

type NetInterfaces struct {
	Data map[string]gopsutil_net.NetInterfaceStat
}

func NewNetInterfaces

func NewNetInterfaces() *NetInterfaces

func (*NetInterfaces) Run

func (n *NetInterfaces) Run() error

Run gathers network interfaces data from gopsutil.

func (*NetInterfaces) ToJson

func (n *NetInterfaces) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Ps

type Ps struct {
	Data map[string]map[string]interface{}
}

func NewPs

func NewPs() *Ps

func (*Ps) Run

func (p *Ps) Run() error

Run gathers ps information from gosigar.

func (*Ps) ToJson

func (p *Ps) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Uptime

type Uptime struct {
	Data map[string]interface{}
}

Uptime is a reader that presents its data in the form similar to `uptime`. Data source: https://github.com/cloudfoundry/gosigar/tree/master

func NewUptime

func NewUptime() *Uptime

func (*Uptime) Run

func (u *Uptime) Run() error

Run gathers uptime information from gosigar.

func (*Uptime) ToJson

func (u *Uptime) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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