common

package
v0.0.0-...-4097794 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CollectorVersion       string
	CollectorVersionSuffix string
	GitRevision            string
)

Functions

func ConvertLineBreak

func ConvertLineBreak(data []byte) []byte

func CreatePathToFile

func CreatePathToFile(filepath string) error

func EncloseWith

func EncloseWith(data string, sep string) string

func EnsureLineBreak

func EnsureLineBreak(data string) string

func FileExists

func FileExists(filePath string) error

func GetCollectorId

func GetCollectorId(collectorId string) string

func GetCpuIdle

func GetCpuIdle() float64

func GetFileSystemList75

func GetFileSystemList75() []string

func GetHostIP

func GetHostIP() string

func GetHostname

func GetHostname() (string, error)

func GetLoad1

func GetLoad1() float64

func GetRootPath

func GetRootPath() (string, error)

func GetSystemName

func GetSystemName() string

func Inspect

func Inspect(object interface{}) string

func IsDir

func IsDir(filePath string) bool

func LinuxPlatformFamily

func LinuxPlatformFamily() string

func RandomUuid

func RandomUuid() string

Types

type CPU

type CPU struct {
	LastCpuTimes *CpuTimes
}

func (*CPU) AddCpuPercentage

func (cpu *CPU) AddCpuPercentage(t2 *CpuTimes)

type CpuTimes

type CpuTimes struct {
	sigar.Cpu
	UserPercent    float64
	SystemPercent  float64
	IdlePercent    float64
	IOwaitPercent  float64
	IrqPercent     float64
	NicePercent    float64
	SoftIrqPercent float64
	StealPercent   float64
}

func GetCpuPercentage

func GetCpuPercentage(last *CpuTimes, current *CpuTimes) *CpuTimes

func GetCpuTimes

func GetCpuTimes() (*CpuTimes, error)

type File

type File struct {
	Path    string    `json:"path"`
	ModTime time.Time `json:"mod_time"`
	Size    int64     `json:"size"`
	IsDir   bool      `json:"is_dir"`
}

func ListFiles

func ListFiles(paths []string) []File

Jump to

Keyboard shortcuts

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