Documentation ¶
Overview ¶
+build linux
+build linux
Index ¶
Constants ¶
const (
MeminfoFile = "/proc/meminfo"
)
Variables ¶
This section is empty.
Functions ¶
func CollectorWrapper ¶
func CollectorWrapper(done <-chan bool, plug DataCollector) (<-chan Result, <-chan error)
CollectorWrapper wraps plugins to create channels and call CollectData as a goroutine.
Returns a result channel and an error channel
func SplitMeminfoLine ¶
SplitMeminfoLine splits each line of /proc/meminfo into key/value pairs. Returns a string and a string pair.
Types ¶
type Collection ¶
Collection is a group of metrics namespaced by their plugin name.
type DataCollector ¶
type DataCollector interface {
CollectData() (string, map[string]*MetricValue, error)
}
DataCollector's must define a CollectData() method.
` type MemoryPlugin struct {}
func (plug MemoryPlugin) CollectData() (string, map[string]*MetricValue, error) { ... } `
type Memory ¶
type Memory struct {
Name string
}
func (*Memory) CollectData ¶
func (m *Memory) CollectData() (string, map[string]*MetricValue, error)
Memory.CollectData returns memory information about the system. Values are in KB. Returns a string and a map[string]interface{}.
type MetricValue ¶
type MetricValue struct {
Val string
}
type Platform ¶
type Platform struct {
Name string
}
func (Platform) CollectData ¶
func (p Platform) CollectData() (string, map[string]*MetricValue, error)
type Result ¶
type Result struct { PluginName string Metrics map[string]*MetricValue }
Result is a struct that holds a map of metrics for a specific plugin.