metric

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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