Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collector ¶
type Collector interface { Prefix() string Describe() []*Description Collect() Metrics Stop() }
type Description ¶
type Description struct {
// contains filtered or unexported fields
}
func NewDesc ¶
func NewDesc(name, description string, labels []string) *Description
func (*Description) Description ¶
func (d *Description) Description() string
func (*Description) Labels ¶ added in v16.10.0
func (d *Description) Labels() []string
func (*Description) Name ¶
func (d *Description) Name() string
func (*Description) String ¶ added in v16.10.0
func (d *Description) String() string
type Metrics ¶
type Metrics interface { // Value returns the first value that matches the name and the labels. The labels // are used to create a pattern and therefore must obey to the rules of NewPattern. Value(name string, labels ...string) Value // Values returns all values that matches the name and the labels. The labels // are used to create a pattern and therefore must obey to the rules of NewPattern. Values(name string, labels ...string) []Value // Labels return a list of all values for a label. Labels(name string, label string) []string // All returns all values currently stored in the collection. All() []Value // Add adds a value to the collection. Add(v Value) // String return a string representation of all collected values. String() string }
Metrics is a collection of values
type Pattern ¶
type Pattern interface { // Name returns the name of the metric this pattern is designated to. Name() string // Match returns whether a map of labels with its label values // match this pattern. All labels have to be present and need to match. Match(labels map[string]string) bool // IsValid returns whether the pattern is valid. IsValid() bool }
func NewPattern ¶
NewPattern creates a new pattern with the given prefix and group name. There has to be an even number of labels, which is ("label", "labelvalue", "label", "labelvalue" ...). The label value will be interpreted as regular expression.
Click to show internal directories.
Click to hide internal directories.