mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-11-14 14:07:26 +01:00
be20f956c2
* InfiniBandCollector: Scale raw readings from octets to bytes * Fix clock frequency coming from LikwidCollector and update docs * Build DEB package for Ubuntu 20.04 for releases * Fix memstat collector with numa_stats option * Remove useless prints from MemstatCollector * Replace ioutils with os and io (#87) * Use lower case for error strings in RocmSmiCollector * move maybe-usable-by-other-cc-components to pkg. Fix all files to use the new paths (#88) * Add collector for monitoring the execution of cc-metric-collector itself (#81) * Add collector to monitor execution of cc-metric-collector itself * Register SelfCollector * Fix import paths for moved packages
41 lines
925 B
Go
41 lines
925 B
Go
package receivers
|
|
|
|
import (
|
|
lp "github.com/ClusterCockpit/cc-metric-collector/pkg/ccMetric"
|
|
)
|
|
|
|
type defaultReceiverConfig struct {
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
// Receiver configuration: Listen address, port
|
|
type ReceiverConfig struct {
|
|
Addr string `json:"address"`
|
|
Port string `json:"port"`
|
|
Database string `json:"database"`
|
|
Organization string `json:"organization,omitempty"`
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
type receiver struct {
|
|
name string
|
|
sink chan lp.CCMetric
|
|
}
|
|
|
|
type Receiver interface {
|
|
Start()
|
|
Close() // Close / finish metric receiver
|
|
Name() string // Name of the metric receiver
|
|
SetSink(sink chan lp.CCMetric) // Set sink channel
|
|
}
|
|
|
|
// Name returns the name of the metric receiver
|
|
func (r *receiver) Name() string {
|
|
return r.name
|
|
}
|
|
|
|
// SetSink set the sink channel
|
|
func (r *receiver) SetSink(sink chan lp.CCMetric) {
|
|
r.sink = sink
|
|
}
|