collector

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT                = "default"
	SUBSCRIBE_ALIVE_TOPICS = "subscribeAliveTopics"
	UNSUBSCRIBE            = "unsubscribe"
	CLOSE                  = "close"
	TOPIC_HEARTBEAT        = 6
)

Variables

View Source
var KafkaConfig *kafka.ConfigMap

Functions

func ReturnDiffTopicList added in v0.2.8

func ReturnDiffTopicList(a, b []string) (diff []string)

Types

type Aggregator

type Aggregator struct {
	AggregateType types.AggregateType
}

func (*Aggregator) AggregateMetric

func (a *Aggregator) AggregateMetric(kafkaConn *kafka.Consumer, topics []string) ([]string, error)

func (*Aggregator) CalculateMetric

func (a *Aggregator) CalculateMetric(responseMap map[string]map[string]map[string][]float64, tagMap map[string]map[string]string, aggregateType string) (map[string]interface{}, error)

type MetricCollector

type MetricCollector struct {
	CreateOrder       int
	ConsumerKafkaConn *kafka.Consumer
	AdminKafkaConn    *kafka.AdminClient
	Aggregator        Aggregator
	Ch                chan string
}

func NewMetricCollector

func NewMetricCollector(aggregateType types.AggregateType, createOrder int) (MetricCollector, error)

func (*MetricCollector) Collector added in v0.2.8

func (mc *MetricCollector) Collector(wg *sync.WaitGroup) error

type TelegrafMetric

type TelegrafMetric struct {
	Name      string                 `json:"name"`
	Tags      map[string]interface{} `json:"tags"`
	Fields    map[string]interface{} `json:"fields"`
	Timestamp int64                  `json:"timestamp"`
	TagInfo   map[string]interface{} `json:"tagInfo"`
}

Jump to

Keyboard shortcuts

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