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: 0

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

func GetMetricOptions() map[string]interface{}

func GetMetricTags

func GetMetricTags() map[string][]string

func GetMetricTypeKey

func GetMetricTypeKey() map[string]interface{}

func GetMetricUsages

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

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

type Creator

type Creator func() Collector

type ExtCollector

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