metric

package
v0.0.0-...-1b88b3c Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2017 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchMetricFamilies

func FetchMetricFamilies(url string, ch chan<- *dto.MetricFamily)

FetchMetricFamilies does stuff

func ParseResponse

func ParseResponse(resp *http.Response, ch chan<- *dto.MetricFamily)

Types

type Family

type Family struct {
	Time    time.Time
	Name    string        `json:"name"`
	Help    string        `json:"help"`
	Type    string        `json:"type"`
	Metrics []interface{} `json:"metrics,omitempty"` // Either metric or summary.
}

MetricFamily holds the family... :)

func NewFamily

func NewFamily(dtoMF *dto.MetricFamily) *Family

func (*Family) AddLabel

func (f *Family) AddLabel(key, val string)

func (*Family) ToOpenTSDBv1

func (f *Family) ToOpenTSDBv1() string

type Histogram

type Histogram struct {
	Labels  map[string]string `json:"labels,omitempty"`
	Buckets map[string]string `json:"buckets,omitempty"`
	Count   string            `json:"count"`
	Sum     string            `json:"sum"`
}

type Metric

type Metric struct {
	Labels map[string]string `json:"labels,omitempty"`
	Value  string            `json:"value"`
}

Metric is for all "single value" metrics.

type Summary

type Summary struct {
	Labels    map[string]string `json:"labels,omitempty"`
	Quantiles map[string]string `json:"quantiles,omitempty"`
	Count     string            `json:"count"`
	Sum       string            `json:"sum"`
}

Jump to

Keyboard shortcuts

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