metric

package
v0.0.0-...-04b0b85 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMetricError = "error"

Variables

This section is empty.

Functions

func TypeTag

func TypeTag(metricType string) map[string]string

func ValueField

func ValueField(metricValue interface{}) map[string]interface{}

Types

type Collector

type Collector interface {
	// When cancelC is closed, collector needs to start closing.
	// After cancelC is closed, metricC is subsequently closed,
	// collector needs to close doneC after completing the closing work.
	Start(cancelC <-chan struct{}, metricC <-chan *Metric) (doneC <-chan struct{})
}

type DefaultRequestMetric

type DefaultRequestMetric string
const (
	DefaultRequestMetricDNSLookup         DefaultRequestMetric = "dns_lookup"
	DefaultRequestMetricTCPConnection     DefaultRequestMetric = "tcp_connection"
	DefaultRequestMetricTLSHandshake      DefaultRequestMetric = "tls_handshake"
	DefaultRequestMetricWaitingConnection DefaultRequestMetric = "waiting_connection"
	DefaultRequestMetricSending           DefaultRequestMetric = "sending"
	DefaultRequestMetricWaitingServer     DefaultRequestMetric = "waiting_server"
	DefaultRequestMetricReceiving         DefaultRequestMetric = "receiving"
	DefaultRequestMetricRequestNumber     DefaultRequestMetric = "request_number"
)

type Metric

type Metric struct {
	Name      string
	Tags      map[string]string
	Fields    map[string]interface{}
	Timestamp time.Time
}

func NewTypeValueMetric

func NewTypeValueMetric(name string, metricType string, metricValue interface{}, timestamp time.Time) *Metric

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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