Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface { // Get new metrics and expose them via prometheus registry. Update(ch chan<- prometheus.Metric) error }
Collector is the interface a collector has to implement.
type Master ¶
type Master struct { Collectors map[string]Collector RClient *rclient.RClient CollectorInterval int }
Master implements the prometheus.Collector interface.
func NewCollectorMaster ¶
NewCollectorMaster creates a new NodeCollector.
func (*Master) Collect ¶
func (cm *Master) Collect(ch chan<- prometheus.Metric)
Collect implements required collect function for all promehteus collectors
func (*Master) Describe ¶
func (cm *Master) Describe(ch chan<- *prometheus.Desc)
Describe is a Prometheus implementation to be called by collector. It essentially writes all descriptors to the prometheus desc channel.
type Metric ¶
type Metric struct { Prom *prometheus.Desc Name string NameRaw string NameDim string Value float64 Type rclient.MetricType Labels []string LabelsValue []string }
Metric describe the metric attributes
type RMetrics ¶
RMetrics keeps the collector info
func NewCollectorMetrics ¶
func NewCollectorMetrics(rcli *rclient.RClient, colInterval int, msEnabled ...string) (*RMetrics, error)
NewCollectorMetrics return the CollectorAnalytics object
func (*RMetrics) InitCollectorsUpdater ¶
func (ca *RMetrics) InitCollectorsUpdater()
InitCollectorsUpdater start the paralel auto update for each collector
func (*RMetrics) InitMetrics ¶
InitMetrics initialize a list of metrics names and return error if fails.