collectors

package
v0.0.0-...-a9fffeb Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2015 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultFreq is the duration between collection intervals if none is
	// specified.
	DefaultFreq = time.Second * 15

	AddTags datapoint.TagSet
)
View Source
var CPU_FIELDS = []string{
	"user",
	"nice",
	"system",
	"idle",
	"iowait",
	"irq",
	"softirq",
	"steal",
	"guest",
	"guest_nice",
}

Functions

func Add

func Add(md *datapoint.MultiDataPoint, name string, value interface{}, t datapoint.TagSet, rate metadata.RateType, unit metadata.Unit, desc string)

Add appends a new data point with given metric name, value, and tags. Tags may be nil. If tags is nil or does not contain a host key, it will be automatically added. If the value of the host key is the empty string, it will be removed (use this to prevent the normal auto-adding of the host tag).

func AddTS

func AddTS(md *datapoint.MultiDataPoint, name string, ts int64, value interface{}, t datapoint.TagSet, rate metadata.RateType, unit metadata.Unit, desc string)

AddTS is the same as Add but lets you specify the timestamp

func ICMP

func ICMP(host string)

ICMP registers an ICMP collector a given host.

func InitFake

func InitFake(fake int)

func InitPrograms

func InitPrograms(cpath string)

func IsAlNum

func IsAlNum(s string) bool

IsAlNum returns true if s is alphanumeric.

func IsDigit

func IsDigit(s string) bool

IsDigit returns true if s consists of decimal digits.

func Run

func Run(cs []Collector) chan *datapoint.DataPoint

Run runs specified collectors. Use nil for all collectors.

func SNMPCisco

func SNMPCisco(community, host string)

SNMPCisco registers a SNMP CISCO collector for the given community and host.

func SNMPIfaces

func SNMPIfaces(community, host string)

SNMPIfaces registers a SNMP Interfaces collector for the given community and host.

func TSys100NStoEpoch

func TSys100NStoEpoch(nsec uint64) int64

func Vsphere

func Vsphere(user, pwd, host string)

Vsphere registers a vSphere collector.

func WatchProcesses

func WatchProcesses(procs []*WatchedProc) error

Types

type Collector

type Collector interface {
	Run(chan<- *datapoint.DataPoint)
	Name() string
	Init()
}
func Search(s string) []Collector

Search returns all collectors matching the pattern s.

type ElasticIndex

type ElasticIndex struct {
	Primaries ElasticIndexDetails `json:"primaries"`
	Total     ElasticIndexDetails `json:"total"`
}

type ElasticIndexDetails

type ElasticIndexDetails struct {
	Completion struct {
		SizeInBytes float64 `json:"size_in_bytes"`
	} `json:"completion"`
	Docs struct {
		Count   float64 `json:"count"`
		Deleted float64 `json:"deleted"`
	} `json:"docs"`
	Fielddata struct {
		Evictions         float64 `json:"evictions"`
		MemorySizeInBytes float64 `json:"memory_size_in_bytes"`
	} `json:"fielddata"`
	FilterCache struct {
		Evictions         float64 `json:"evictions"`
		MemorySizeInBytes float64 `json:"memory_size_in_bytes"`
	} `json:"filter_cache"`
	Flush struct {
		Total             float64 `json:"total"`
		TotalTimeInMillis float64 `json:"total_time_in_millis"`
	} `json:"flush"`
	Get struct {
		Current             float64 `json:"current"`
		ExistsTimeInMillis  float64 `json:"exists_time_in_millis"`
		ExistsTotal         float64 `json:"exists_total"`
		MissingTimeInMillis float64 `json:"missing_time_in_millis"`
		MissingTotal        float64 `json:"missing_total"`
		TimeInMillis        float64 `json:"time_in_millis"`
		Total               float64 `json:"total"`
	} `json:"get"`
	IDCache struct {
		MemorySizeInBytes float64 `json:"memory_size_in_bytes"`
	} `json:"id_cache"`
	Indexing struct {
		DeleteCurrent      float64 `json:"delete_current"`
		DeleteTimeInMillis float64 `json:"delete_time_in_millis"`
		DeleteTotal        float64 `json:"delete_total"`
		IndexCurrent       float64 `json:"index_current"`
		IndexTimeInMillis  float64 `json:"index_time_in_millis"`
		IndexTotal         float64 `json:"index_total"`
	} `json:"indexing"`
	Merges struct {
		Current            float64 `json:"current"`
		CurrentDocs        float64 `json:"current_docs"`
		CurrentSizeInBytes float64 `json:"current_size_in_bytes"`
		Total              float64 `json:"total"`
		TotalDocs          float64 `json:"total_docs"`
		TotalSizeInBytes   float64 `json:"total_size_in_bytes"`
		TotalTimeInMillis  float64 `json:"total_time_in_millis"`
	} `json:"merges"`
	Percolate struct {
		Current           float64 `json:"current"`
		MemorySize        string  `json:"memory_size"`
		MemorySizeInBytes float64 `json:"memory_size_in_bytes"`
		Queries           float64 `json:"queries"`
		TimeInMillis      float64 `json:"time_in_millis"`
		Total             float64 `json:"total"`
	} `json:"percolate"`
	Refresh struct {
		Total             float64 `json:"total"`
		TotalTimeInMillis float64 `json:"total_time_in_millis"`
	} `json:"refresh"`
	Search struct {
		FetchCurrent      float64 `json:"fetch_current"`
		FetchTimeInMillis float64 `json:"fetch_time_in_millis"`
		FetchTotal        float64 `json:"fetch_total"`
		OpenContexts      float64 `json:"open_contexts"`
		QueryCurrent      float64 `json:"query_current"`
		QueryTimeInMillis float64 `json:"query_time_in_millis"`
		QueryTotal        float64 `json:"query_total"`
	} `json:"search"`
	Segments struct {
		Count         float64 `json:"count"`
		MemoryInBytes float64 `json:"memory_in_bytes"`
	} `json:"segments"`
	Store struct {
		SizeInBytes          float64 `json:"size_in_bytes"`
		ThrottleTimeInMillis float64 `json:"throttle_time_in_millis"`
	} `json:"store"`
	Suggest struct {
		Current      float64 `json:"current"`
		TimeInMillis float64 `json:"time_in_millis"`
		Total        float64 `json:"total"`
	} `json:"suggest"`
	Translog struct {
		Operations  float64 `json:"operations"`
		SizeInBytes float64 `json:"size_in_bytes"`
	} `json:"translog"`
	Warmer struct {
		Current           float64 `json:"current"`
		Total             float64 `json:"total"`
		TotalTimeInMillis float64 `json:"total_time_in_millis"`
	} `json:"warmer"`
}

type ElasticIndexHealth

type ElasticIndexHealth struct {
	ActivePrimaryShards float64 `json:"active_primary_shards"`
	ActiveShards        float64 `json:"active_shards"`
	InitializingShards  float64 `json:"initializing_shards"`
	NumberOfReplicas    float64 `json:"number_of_replicas"`
	NumberOfShards      float64 `json:"number_of_shards"`
	RelocatingShards    float64 `json:"relocating_shards"`
	Status              string  `json:"status"`
	UnassignedShards    float64 `json:"unassigned_shards"`
}

type ElasticIndexStats

type ElasticIndexStats struct {
	All    ElasticIndex `json:"_all"`
	Shards struct {
		Failed     float64 `json:"failed"`
		Successful float64 `json:"successful"`
		Total      float64 `json:"total"`
	} `json:"_shards"`
	Indices map[string]ElasticIndex `json:"indices"`
}

type ElasticIndicesHealth

type ElasticIndicesHealth struct {
	ActivePrimaryShards float64                       `json:"active_primary_shards"`
	ActiveShards        float64                       `json:"active_shards"`
	ClusterName         string                        `json:"cluster_name"`
	Indices             map[string]ElasticIndexHealth `json:"indices"`
	InitializingShards  float64                       `json:"initializing_shards"`
	NumberOfDataNodes   float64                       `json:"number_of_data_nodes"`
	NumberOfNodes       float64                       `json:"number_of_nodes"`
	RelocatingShards    float64                       `json:"relocating_shards"`
	Status              string                        `json:"status"`
	TimedOut            bool                          `json:"timed_out"`
	UnassignedShards    float64                       `json:"unassigned_shards`
}

type HostSystemIdentificationInfo

type HostSystemIdentificationInfo struct {
	IdentiferValue string `xml:"identifierValue"`
	IdentiferType  struct {
		Label   string `xml:"label"`
		Summary string `xml:"summary"`
		Key     string `xml:"key"`
	} `xml:"identifierType"`
}

type IntervalCollector

type IntervalCollector struct {
	F        func() (datapoint.MultiDataPoint, error)
	Interval time.Duration // defaults to DefaultFreq if unspecified
	Enable   func() bool

	// internal use
	sync.Mutex
	// contains filtered or unexported fields
}

func (*IntervalCollector) Enabled

func (c *IntervalCollector) Enabled() bool

func (*IntervalCollector) Init

func (c *IntervalCollector) Init()

func (*IntervalCollector) Name

func (c *IntervalCollector) Name() string

func (*IntervalCollector) Run

func (c *IntervalCollector) Run(dpchan chan<- *datapoint.DataPoint)

type PRSummary

type PRSummary struct {
	Changes struct {
		Total float64 `yaml:"total"`
	} `yaml:"changes"`
	Events struct {
		Failure float64 `yaml:"failure"`
		Success float64 `yaml:"success"`
		Total   float64 `yaml:"total"`
	} `yaml:"events"`
	Resources struct {
		Changed         float64 `yaml:"changed"`
		Failed          float64 `yaml:"failed"`
		FailedToRestart float64 `yaml:"failed_to_restart"`
		OutOfSync       float64 `yaml:"out_of_sync"`
		Restarted       float64 `yaml:"restarted"`
		Scheduled       float64 `yaml:"scheduled"`
		Skipped         float64 `yaml:"skipped"`
		Total           float64 `yaml:"total"`
	} `yaml:"resources"`
	Time struct {
		Augeas           float64 `yaml:"augeas"`
		ConfigRetrieval  float64 `yaml:"config_retrieval"`
		Cron             float64 `yaml:"cron"`
		Exec             float64 `yaml:"exec"`
		File             float64 `yaml:"file"`
		Filebucket       float64 `yaml:"filebucket"`
		Group            float64 `yaml:"group"`
		IniSetting       float64 `yaml:"ini_setting"`
		LastRun          int64   `yaml:"last_run"`
		Package          float64 `yaml:"package"`
		Schedule         float64 `yaml:"schedule"`
		Service          float64 `yaml:"service"`
		SshAuthorizedKey float64 `yaml:"ssh_authorized_key"`
		Total            float64 `yaml:"total"`
		User             float64 `yaml:"user"`
		Yumrepo          float64 `yaml:"yumrepo"`
	} `yaml:"time"`
	Version struct {
		Config string `yaml:"config"`
		Puppet string `yaml:"puppet"`
	} `yaml:"version"`
}

type Process

type Process struct {
	Pid       string
	Command   string
	Arguments string
}

type ProgramCollector

type ProgramCollector struct {
	Path     string
	Interval time.Duration
}

func (*ProgramCollector) Init

func (c *ProgramCollector) Init()

func (*ProgramCollector) Name

func (c *ProgramCollector) Name() string

func (*ProgramCollector) Run

func (c *ProgramCollector) Run(dpchan chan<- *datapoint.DataPoint)

type WatchedProc

type WatchedProc struct {
	Command   string
	Name      string
	Processes map[string]int
	ArgMatch  *regexp.Regexp
	// contains filtered or unexported fields
}

func NewWatchedProc

func NewWatchedProc(watch string) (*WatchedProc, error)

NewWatchedProc takes a string of the form "command,name,regex".

func (*WatchedProc) Check

func (w *WatchedProc) Check(procs []*Process)

Check finds all matching processes and assigns them a new unique id.

func (*WatchedProc) Remove

func (w *WatchedProc) Remove(pid string)

Directories

Path Synopsis
Godeps
_workspace/src/github.com/StackExchange/wmi
Package wmi provides a WQL interface for WMI on Windows.
Package wmi provides a WQL interface for WMI on Windows.
_workspace/src/github.com/garyburd/redigo/internal/redistest
Package redistest contains utilities for writing Redigo tests.
Package redistest contains utilities for writing Redigo tests.
_workspace/src/github.com/garyburd/redigo/redis
Package redis is a client for the Redis database.
Package redis is a client for the Redis database.
_workspace/src/github.com/mjibson/snmp
Package snmp provides an implementation of the SNMP specification.
Package snmp provides an implementation of the SNMP specification.
_workspace/src/github.com/mjibson/snmp/mib
Package mib parses modules of the virtual management information store.
Package mib parses modules of the virtual management information store.
_workspace/src/github.com/tatsushid/go-fastping
Package fastping is an ICMP ping library inspired by AnyEvent::FastPing Perl module to send ICMP ECHO REQUEST packets quickly.
Package fastping is an ICMP ping library inspired by AnyEvent::FastPing Perl module to send ICMP ECHO REQUEST packets quickly.
_workspace/src/golang.org/x/net/icmp
Package icmp provides basic functions for the manipulation of messages used in the Internet Control Message Protocols, ICMPv4 and ICMPv6.
Package icmp provides basic functions for the manipulation of messages used in the Internet Control Message Protocols, ICMPv4 and ICMPv6.
_workspace/src/golang.org/x/net/internal/iana
Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).
Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).
_workspace/src/golang.org/x/net/ipv4
Package ipv4 implements IP-level socket options for the Internet Protocol version 4.
Package ipv4 implements IP-level socket options for the Internet Protocol version 4.
_workspace/src/golang.org/x/net/ipv6
Package ipv6 implements IP-level socket options for the Internet Protocol version 6.
Package ipv6 implements IP-level socket options for the Internet Protocol version 6.
_workspace/src/gopkg.in/yaml.v1
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.

Jump to

Keyboard shortcuts

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