Documentation ¶
Overview ¶
Package collector contains the actual fullerite collectors (and the corresponding tests). All collectors need to embed baseCollector. Look at one of the existing collectors (test.go) to see how this is done.
mesos collector (mesos.go): This collector runs on all mesos masters. It identifies the leader amongst masters and collects stats from this leader only. Mesos masters report stats on :5050/metrics/snapshot, which is JSON. All these stats are pushed via fullerite to the configured handlers. Some sanitization is performed to convert the names to a more metric-y style. For example, "masters/cpus" would be changed to "masters.cpu."
Index ¶
- Constants
- func RegisterCollector(name string, f func(chan metric.Metric, int, *l.Entry) Collector)
- type CPUValues
- type Collector
- type Diamond
- func (col *Diamond) CanonicalName() string
- func (col Diamond) Channel() chan metric.Metric
- func (d *Diamond) Collect()
- func (col *Diamond) CollectorType() string
- func (d *Diamond) Configure(configMap map[string]interface{})
- func (col Diamond) Interval() int
- func (col Diamond) Name() string
- func (d *Diamond) Port() string
- func (col *Diamond) SetCanonicalName(name string)
- func (col *Diamond) SetCollectorType(collectorType string)
- func (col *Diamond) SetInterval(interval int)
- func (col Diamond) String() string
- type DockerStats
- func (col *DockerStats) CanonicalName() string
- func (col DockerStats) Channel() chan metric.Metric
- func (d *DockerStats) Collect()
- func (col *DockerStats) CollectorType() string
- func (d *DockerStats) Configure(configMap map[string]interface{})
- func (d *DockerStats) GetEndpoint() string
- func (col DockerStats) Interval() int
- func (col DockerStats) Name() string
- func (col *DockerStats) SetCanonicalName(name string)
- func (col *DockerStats) SetCollectorType(collectorType string)
- func (col *DockerStats) SetInterval(interval int)
- func (col DockerStats) String() string
- type Fullerite
- func (col *Fullerite) CanonicalName() string
- func (col Fullerite) Channel() chan metric.Metric
- func (f Fullerite) Collect()
- func (col *Fullerite) CollectorType() string
- func (f *Fullerite) Configure(configMap map[string]interface{})
- func (col Fullerite) Interval() int
- func (col Fullerite) Name() string
- func (col *Fullerite) SetCanonicalName(name string)
- func (col *Fullerite) SetCollectorType(collectorType string)
- func (col *Fullerite) SetInterval(interval int)
- func (col Fullerite) String() string
- type OpenTSDB
- func (col *OpenTSDB) CanonicalName() string
- func (col OpenTSDB) Channel() chan metric.Metric
- func (c *OpenTSDB) Collect()
- func (col *OpenTSDB) CollectorType() string
- func (c *OpenTSDB) Configure(configMap map[string]interface{})
- func (col OpenTSDB) Interval() int
- func (col OpenTSDB) Name() string
- func (c *OpenTSDB) Port() string
- func (col *OpenTSDB) SetCanonicalName(name string)
- func (col *OpenTSDB) SetCollectorType(collectorType string)
- func (col *OpenTSDB) SetInterval(interval int)
- func (col OpenTSDB) String() string
- type Regex
- type Test
- func (col *Test) CanonicalName() string
- func (col Test) Channel() chan metric.Metric
- func (t Test) Collect()
- func (col *Test) CollectorType() string
- func (t *Test) Configure(configMap map[string]interface{})
- func (col Test) Interval() int
- func (col Test) Name() string
- func (col *Test) SetCanonicalName(name string)
- func (col *Test) SetCollectorType(collectorType string)
- func (col *Test) SetInterval(interval int)
- func (col Test) String() string
Constants ¶
const ( //DefaultOpenTSDBCollectorPort is the TCP port that OpenTSDB clients will push data to DefaultOpenTSDBCollectorPort = "4242" // MetricRegex provides the default OpenTSDB regex MetricRegex = `put (?P<name>[0-9\.\-\_a-zA-Z]+)\s+(?P<dimensions>[0-9\.\-\_\=\,a-zA-Z]+)\s+(?P<time>\d+)\s+(?P<value>[0-9\.]+)` )
const (
// DefaultCollectionInterval the interval to collect on unless overridden by a collectors config
DefaultCollectionInterval = 10
)
const ( // DefaultDiamondCollectorPort is the TCP port that diamond // collectors write to and we read off of. DefaultDiamondCollectorPort = "19191" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CPUValues ¶
type CPUValues struct {
// contains filtered or unexported fields
}
CPUValues struct contains the last cpu-usage values in order to compute properly the current values. (see calculateCPUPercent() for more details)
type Collector ¶
type Collector interface { Collect() Configure(map[string]interface{}) // taken care of by the base class Name() string Channel() chan metric.Metric Interval() int SetInterval(int) CollectorType() string SetCollectorType(string) CanonicalName() string SetCanonicalName(string) }
Collector defines the interface of a generic collector.
type Diamond ¶
type Diamond struct {
// contains filtered or unexported fields
}
Diamond collector type
func (*Diamond) CanonicalName ¶
func (col *Diamond) CanonicalName() string
CanonicalName : collector canonical name
func (*Diamond) Collect ¶
func (d *Diamond) Collect()
Collect reads metrics collected from Diamond collectors, converts them to fullerite's Metric type and publishes them to handlers.
func (*Diamond) CollectorType ¶
func (col *Diamond) CollectorType() string
CollectorType : collector type
func (Diamond) Interval ¶
func (col Diamond) Interval() int
Interval : the interval to collect the metrics on
func (*Diamond) SetCanonicalName ¶
func (col *Diamond) SetCanonicalName(name string)
SetCanonicalName : collector canonical name
func (*Diamond) SetCollectorType ¶
func (col *Diamond) SetCollectorType(collectorType string)
SetCollectorType : collector type
func (*Diamond) SetInterval ¶
func (col *Diamond) SetInterval(interval int)
SetInterval : set the interval to collect on
type DockerStats ¶
type DockerStats struct {
// contains filtered or unexported fields
}
DockerStats collector type. previousCPUValues contains the last cpu-usage values per container. dockerClient is the client for the Docker remote API.
func (*DockerStats) CanonicalName ¶
func (col *DockerStats) CanonicalName() string
CanonicalName : collector canonical name
func (*DockerStats) Collect ¶
func (d *DockerStats) Collect()
Collect iterates on all the docker containers alive and, if possible, collects the correspondent memory and cpu statistics. For each container a gorutine is started to spin up the collection process.
func (*DockerStats) CollectorType ¶
func (col *DockerStats) CollectorType() string
CollectorType : collector type
func (*DockerStats) Configure ¶
func (d *DockerStats) Configure(configMap map[string]interface{})
Configure takes a dictionary of values with which the handler can configure itself.
func (*DockerStats) GetEndpoint ¶
func (d *DockerStats) GetEndpoint() string
GetEndpoint Returns endpoint of DockerStats instance
func (DockerStats) Interval ¶
func (col DockerStats) Interval() int
Interval : the interval to collect the metrics on
func (*DockerStats) SetCanonicalName ¶
func (col *DockerStats) SetCanonicalName(name string)
SetCanonicalName : collector canonical name
func (*DockerStats) SetCollectorType ¶
func (col *DockerStats) SetCollectorType(collectorType string)
SetCollectorType : collector type
func (*DockerStats) SetInterval ¶
func (col *DockerStats) SetInterval(interval int)
SetInterval : set the interval to collect on
type Fullerite ¶
type Fullerite struct {
// contains filtered or unexported fields
}
Fullerite collector type
func (*Fullerite) CanonicalName ¶
func (col *Fullerite) CanonicalName() string
CanonicalName : collector canonical name
func (*Fullerite) CollectorType ¶
func (col *Fullerite) CollectorType() string
CollectorType : collector type
func (*Fullerite) Configure ¶
Configure this takes a dictionary of values with which the handler can configure itself
func (Fullerite) Interval ¶
func (col Fullerite) Interval() int
Interval : the interval to collect the metrics on
func (*Fullerite) SetCanonicalName ¶
func (col *Fullerite) SetCanonicalName(name string)
SetCanonicalName : collector canonical name
func (*Fullerite) SetCollectorType ¶
func (col *Fullerite) SetCollectorType(collectorType string)
SetCollectorType : collector type
func (*Fullerite) SetInterval ¶
func (col *Fullerite) SetInterval(interval int)
SetInterval : set the interval to collect on
type OpenTSDB ¶
type OpenTSDB struct {
// contains filtered or unexported fields
}
OpenTSDB collector type
func (*OpenTSDB) CanonicalName ¶
func (col *OpenTSDB) CanonicalName() string
CanonicalName : collector canonical name
func (*OpenTSDB) Collect ¶
func (c *OpenTSDB) Collect()
Collect reads metrics collected from OpenTSDB collectors, converts them to fullerite's Metric type and publishes them to handlers.
func (*OpenTSDB) CollectorType ¶
func (col *OpenTSDB) CollectorType() string
CollectorType : collector type
func (OpenTSDB) Interval ¶
func (col OpenTSDB) Interval() int
Interval : the interval to collect the metrics on
func (*OpenTSDB) SetCanonicalName ¶
func (col *OpenTSDB) SetCanonicalName(name string)
SetCanonicalName : collector canonical name
func (*OpenTSDB) SetCollectorType ¶
func (col *OpenTSDB) SetCollectorType(collectorType string)
SetCollectorType : collector type
func (*OpenTSDB) SetInterval ¶
func (col *OpenTSDB) SetInterval(interval int)
SetInterval : set the interval to collect on
type Regex ¶
type Regex struct {
// contains filtered or unexported fields
}
Regex struct contains the info used to get the user specific dimensions from the docker env variables tag: is the environmental variable you want to get the value from regex: is the reg exp used to extract the value from the env var
type Test ¶
type Test struct {
// contains filtered or unexported fields
}
Test collector type
func (*Test) CanonicalName ¶
func (col *Test) CanonicalName() string
CanonicalName : collector canonical name
func (*Test) Configure ¶
Configure this takes a dictionary of values with which the handler can configure itself
func (Test) Interval ¶
func (col Test) Interval() int
Interval : the interval to collect the metrics on
func (*Test) SetCanonicalName ¶
func (col *Test) SetCanonicalName(name string)
SetCanonicalName : collector canonical name
func (*Test) SetCollectorType ¶
func (col *Test) SetCollectorType(collectorType string)
SetCollectorType : collector type
func (*Test) SetInterval ¶
func (col *Test) SetInterval(interval int)
SetInterval : set the interval to collect on