types

package
v2.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectChunk

type CollectChunk struct {
	Metrics  []*Metric
	Warnings []Warning
	Err      error
}

type Collector

type Collector interface {
	plugin.Collector
	plugin.StreamingCollector

	Name() string
	Version() string
	Type() PluginType

	Unwrap() interface{} // Returns wrapped user-defined collector or streaming collector (with access to Load(), Unload() etc.)
}

Simple wrapper which enables using common code for collector and streaming collector.

func NewCollector

func NewCollector(name string, version string, collector plugin.Collector) Collector

func NewStreamingCollector

func NewStreamingCollector(name string, version string, collector plugin.StreamingCollector) Collector

type Metric

type Metric struct {
	Namespace_   []NamespaceElement
	Value_       interface{}
	Tags_        map[string]string
	Unit_        string
	Timestamp_   time.Time
	Description_ string
	Type_        plugin.MetricType
}

func (*Metric) AddTags

func (m *Metric) AddTags(tags map[string]string)

func (Metric) Description

func (m Metric) Description() string

func (Metric) Namespace

func (m Metric) Namespace() plugin.Namespace

func (*Metric) RemoveTags

func (m *Metric) RemoveTags(keys []string)

func (*Metric) SetDescription

func (m *Metric) SetDescription(description string)

func (*Metric) SetTimestamp

func (m *Metric) SetTimestamp(timestamp time.Time)

func (*Metric) SetType added in v2.3.0

func (m *Metric) SetType(type_ plugin.MetricType)

func (*Metric) SetUnit

func (m *Metric) SetUnit(unit string)

func (Metric) String

func (m Metric) String() string

func (Metric) Tags

func (m Metric) Tags() map[string]string

func (Metric) Timestamp

func (m Metric) Timestamp() time.Time

func (Metric) Type added in v2.3.0

func (m Metric) Type() plugin.MetricType

func (Metric) Unit

func (m Metric) Unit() string

func (Metric) Value

func (m Metric) Value() interface{}

type Namespace

type Namespace []NamespaceElement

func (Namespace) At

func (ns Namespace) At(pos int) plugin.NamespaceElement

func (Namespace) HasElement

func (ns Namespace) HasElement(el string) bool

func (Namespace) HasElementOn

func (ns Namespace) HasElementOn(el string, pos int) bool

func (Namespace) Len

func (ns Namespace) Len() int

func (Namespace) String

func (ns Namespace) String() string

type NamespaceElement

type NamespaceElement struct {
	Name_        string
	Value_       string
	Description_ string
}

func (*NamespaceElement) Description

func (ns *NamespaceElement) Description() string

func (*NamespaceElement) IsDynamic

func (ns *NamespaceElement) IsDynamic() bool

func (*NamespaceElement) Name

func (ns *NamespaceElement) Name() string

func (*NamespaceElement) String

func (ns *NamespaceElement) String() string

func (*NamespaceElement) Value

func (ns *NamespaceElement) Value() string

type PluginType

type PluginType int
const (
	PluginTypeCollector PluginType = iota
	PluginTypeProcessor
	PluginTypePublisher
	PluginTypeStreamingCollector
)

func (PluginType) String

func (pt PluginType) String() string

type ProcessingStatus

type ProcessingStatus struct {
	Error    error
	Warnings []Warning
}

Contains additional information about warnings raised during collect / publish processes

type Warning

type Warning struct {
	Message   string
	Timestamp time.Time
}

Jump to

Keyboard shortcuts

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