Documentation ¶
Index ¶
- Constants
- func CloudID() string
- func CollectPluginsData(configuredPlugins []plugins.ConfiguredPlugin) (interface{}, interface{})
- func GetMetadataURL(provider string, url string) string
- func GetOrCreateMachineID() string
- func Host() string
- func IPAddress() string
- func SliceFindStringIndex(s []string, e string) int
- func Uptime() string
- type AllMetricsStruct
- type CPUUsageStruct
- type DiskIOList
- type DiskIOtruct
- type DiskUsageList
- type DiskUsageStruct
- type DistroStruct
- type HostDataStruct
- type LoadStruct
- type MemoryStruct
- type NetworkStruct
- type NetworkUsageList
- type PluginResultStruct
- type ProcessStruct
- type ProcessesList
- type SystemDataStruct
Constants ¶
const ( MINUTE = 60 HOUR = MINUTE * 60 DAY = HOUR * 24 )
conversion units
Variables ¶
This section is empty.
Functions ¶
func CollectPluginsData ¶
func CollectPluginsData(configuredPlugins []plugins.ConfiguredPlugin) (interface{}, interface{})
CollectPluginsData - XXX
func SliceFindStringIndex ¶
SliceFindStringIndex - XXX
Types ¶
type AllMetricsStruct ¶
type AllMetricsStruct struct { System SystemDataStruct `json:"system"` Processes ProcessesList `json:"processes"` Host HostDataStruct `json:"host"` Plugins interface{} `json:"plugins"` Checks interface{} `json:"checks"` }
AllMetricsStruct -XXX
func CollectAllData ¶
func CollectAllData(configuredPlugins []plugins.ConfiguredPlugin) AllMetricsStruct
CollectAllData - XXX
func (AllMetricsStruct) String ¶
func (p AllMetricsStruct) String() string
type CPUUsageStruct ¶
type CPUUsageStruct struct { User float64 `json:"user"` Idle float64 `json:"idle"` Nice float64 `json:"nice"` Steal float64 `json:"steal"` System float64 `json:"system"` IOWait float64 `json:"iowait"` }
CPUUsageStruct - returns CPU usage stats
func (CPUUsageStruct) String ¶
func (p CPUUsageStruct) String() string
type DiskIOtruct ¶
type DiskIOtruct struct { Name string `json:"name"` Path string `json:"path"` Reads int64 `json:"reads"` Writes int64 `json:"writes"` ReadBytes float64 `json:"bytes.read"` WriteBytes float64 `json:"bytes.write"` WriteTime int64 `json:"write_time"` ReadTime int64 `json:"read_time"` }
DiskIOtruct - volume io data
func (DiskIOtruct) String ¶
func (p DiskIOtruct) String() string
type DiskUsageList ¶
type DiskUsageList []DiskUsageStruct
DiskUsageList - list of volume usage data
func DiskUsage ¶
func DiskUsage() (DiskUsageList, error)
DiskUsage - return a list with disk usage structs
type DiskUsageStruct ¶
type DiskUsageStruct struct { Name string `json:"name"` Path string `json:"path"` Fstype string `json:"fstype"` Total string `json:"total"` Free string `json:"free"` Used string `json:"used"` UsedPercent float64 `json:"percent"` }
DiskUsageStruct - volume usage data {'sda1': {'used': '28851', 'percent': 84.0, 'free': '5625', 'volume': '/dev/sda1', 'path': '/', 'total': '36236'}
func (DiskUsageStruct) String ¶
func (p DiskUsageStruct) String() string
type DistroStruct ¶
DistroStruct - returns information about the currently instaled distro
func Distro ¶
func Distro() DistroStruct
Distro - gets distro info {'version': '14.04', 'name': 'Ubuntu'}
func (DistroStruct) String ¶
func (p DistroStruct) String() string
type HostDataStruct ¶
type HostDataStruct struct { Host string `json:"host"` MachineID string `json:"machineid"` ServerKey string `json:"server_key"` Distro DistroStruct `json:"distro"` IPAddress string `json:"ip_address"` InstanceID string `json:"instance_id"` }
HostDataStruct -XXX
func (HostDataStruct) String ¶
func (p HostDataStruct) String() string
type LoadStruct ¶
type LoadStruct struct { Minute float64 `json:"minute"` FiveMinutes float64 `json:"five_minutes"` FifteenMinutes float64 `json:"fifteen_minutes"` Cores int `json:"cores"` }
LoadStruct - returns load avg
func (LoadStruct) String ¶
func (p LoadStruct) String() string
{'cores': 1, 'fifteen_minutes': '0.14', 'five_minutes': '0.11', 'minute': '0.01'}
type MemoryStruct ¶
type MemoryStruct struct { UsedPercent float64 `json:"used_percent"` UsedMB float64 `json:"used_mb"` TotalMB float64 `json:"total_mb"` FreeMB float64 `json:"free_mb"` SwapUsedMB float64 `json:"swap_used_mb"` SwapFreeMB float64 `json:"swap_free_mb"` SwapTotalMB float64 `json:"swap_total_mb"` SwapUsedPercent float64 `json:"swap_used_percent"` }
MemoryStruct - XXX
func (MemoryStruct) String ¶
func (p MemoryStruct) String() string
type NetworkStruct ¶
type NetworkStruct struct { Inbound float64 `json:"inbound"` Outbound float64 `json:"outbound"` Name string `json:"name"` }
NetworkStruct - net interfaces data
func (NetworkStruct) String ¶
func (p NetworkStruct) String() string
type PluginResultStruct ¶
type PluginResultStruct struct { Name string Result interface{} }
PluginResultStruct - a channel struct that holds plugin results
type ProcessStruct ¶
type ProcessStruct struct { CPU float64 `json:"cpu"` Memory string `json:"memory_mb"` KBRead float64 `json:"kb_read"` KBWrite float64 `json:"kb_write"` Name string `json:"name"` }
ProcessStruct - individual process data
func (ProcessStruct) String ¶
func (p ProcessStruct) String() string
type ProcessesList ¶
type ProcessesList []ProcessStruct
ProcessesList - list of individual process data
func Processes ¶
func Processes() (ProcessesList, error)
Processes - get data from sysstat, format and return the result
type SystemDataStruct ¶
type SystemDataStruct struct { CPU CPUUsageStruct `json:"cpu"` Network NetworkUsageList `json:"network"` Disk DiskUsageList `json:"disk"` Load LoadStruct `json:"loadavg"` Uptime string `json:"uptime"` Memory MemoryStruct `json:"memory"` }
SystemDataStruct - collect all system metrics
func (SystemDataStruct) String ¶
func (p SystemDataStruct) String() string