metric

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 3 Imported by: 25

Documentation

Index

Constants

View Source
const (
	ConfigTypeBool   = "bool"
	ConfigTypeArray  = "array"
	ConfigTypeString = "string"

	OptionString     = "options"
	AttributesString = "attributes"
	Timestamp        = "timestamp"
)

Variables

View Source
var Collectors = map[string]Creator{}

Functions

func Add

func Add(name string, creator Creator)

func GetMetricOptions added in v1.3.6

func GetMetricOptions() map[string]interface{}

func GetMetricTags added in v1.4.0

func GetMetricTags() map[string][]string

func GetMetricTypeKey added in v1.3.6

func GetMetricTypeKey() map[string]interface{}

func GetMetricUsages added in v1.3.6

func GetMetricUsages() []Option

Types

type Collector

type Collector interface {
	// Name returns the name.
	Name() string
	// Tags returns available tags.
	Tags() []string
	// Usages returns usage information.
	Usages() string
	// Config returns config fields and options.
	Config() map[string]interface{}
	// Collect gathers metric infomration.
	Collect() ([]map[string]interface{}, error)
}

Collector 收集metric�s的接口

type CollectorService added in v1.5.4

type CollectorService interface {
	Close() error
	Start() error
}

type Creator

type Creator func() Collector

type ExtCollector added in v1.5.0

type ExtCollector interface {
	Collector
	// SyncConfig updates config options specifically for external metrics.
	SyncConfig(map[string]interface{}, *reader.Meta) error
}

供外部插件实现 SyncConfig 与 Config 对应 获取配置项后同步配置给插件

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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