metric

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 3 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	M3CounterValue = []byte("counter")
	M3GaugeValue   = []byte("gauge")
	M3TimerValue   = []byte("timer")

	PromUnknownValue        = []byte("unknown")
	PromCounterValue        = []byte("counter")
	PromGaugeValue          = []byte("gauge")
	PromHistogramValue      = []byte("histogram")
	PromGaugeHistogramValue = []byte("gauge_histogram")
	PromSummaryValue        = []byte("summary")
	PromInfoValue           = []byte("info")
	PromStateSetValue       = []byte("state_set")
	PromQuantileName        = []byte("quantile")

	M3MetricsPrefix       = []byte("__m3")
	M3MetricsPrefixString = string(M3MetricsPrefix)

	M3TypeTag                    = []byte(M3MetricsPrefixString + "_type__")
	M3MetricsGraphiteAggregation = []byte(M3MetricsPrefixString + "_graphite_aggregation__")
	M3MetricsGraphitePrefix      = []byte(M3MetricsPrefixString + "_graphite_prefix__")
	M3MetricsDropTimestamp       = []byte(M3MetricsPrefixString + "_drop_timestamp__")
	M3PromTypeTag                = []byte(M3MetricsPrefixString + "_prom_type__")
	M3MetricsPromSummary         = []byte(M3MetricsPrefixString + "_prom_summary__")
)
View Source
var ValidTypes = []Type{
	CounterType,
	TimerType,
	GaugeType,
}

ValidTypes is a list of valid metric types.

Functions

This section is empty.

Types

type Type

type Type int

Type is a metric type.

const (
	UnknownType Type = iota
	CounterType
	TimerType
	GaugeType
)

A list of supported metric types.

func MustParseType

func MustParseType(typeStr string) Type

MustParseType parses a type string and panics if the input in invalid.

func ParseType

func ParseType(typeStr string) (Type, error)

ParseType parses a type string and returns the type.

func (*Type) FromProto

func (t *Type) FromProto(pb metricpb.MetricType) error

FromProto converts the protobuf message to a metric type.

func (Type) String

func (t Type) String() string

func (Type) ToProto

func (t Type) ToProto(pb *metricpb.MetricType) error

ToProto converts the metric type to a protobuf message in place.

func (*Type) UnmarshalYAML

func (t *Type) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals YAML object into a metric type.

Directories

Path Synopsis
id
Package id is a generated GoMock package.
Package id is a generated GoMock package.
m3
Package m3 describes m3 metric id information.
Package m3 describes m3 metric id information.

Jump to

Keyboard shortcuts

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