metric

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthMetric        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMetric          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMetric = fmt.Errorf("proto: unexpected end of group")
)
View Source
var MetricType_name = map[int32]string{
	0: "COUNTER",
	1: "GAUGE",
	2: "RAWHIST",
}
View Source
var MetricType_value = map[string]int32{
	"COUNTER": 0,
	"GAUGE":   1,
	"RAWHIST": 2,
}

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Value                float64  `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Counter) Descriptor

func (*Counter) Descriptor() ([]byte, []int)

func (*Counter) GetValue

func (m *Counter) GetValue() float64

func (*Counter) Marshal

func (m *Counter) Marshal() (dAtA []byte, err error)

func (*Counter) MarshalTo

func (m *Counter) MarshalTo(dAtA []byte) (int, error)

func (*Counter) MarshalToSizedBuffer

func (m *Counter) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Counter) ProtoMessage

func (*Counter) ProtoMessage()

func (*Counter) Reset

func (m *Counter) Reset()

func (*Counter) Size

func (m *Counter) Size() (n int)

func (*Counter) String

func (m *Counter) String() string

func (*Counter) Unmarshal

func (m *Counter) Unmarshal(dAtA []byte) error

func (*Counter) XXX_DiscardUnknown

func (m *Counter) XXX_DiscardUnknown()

func (*Counter) XXX_Marshal

func (m *Counter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Counter) XXX_Merge

func (m *Counter) XXX_Merge(src proto.Message)

func (*Counter) XXX_Size

func (m *Counter) XXX_Size() int

func (*Counter) XXX_Unmarshal

func (m *Counter) XXX_Unmarshal(b []byte) error

type Gauge

type Gauge struct {
	Value                float64  `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Gauge) Descriptor

func (*Gauge) Descriptor() ([]byte, []int)

func (*Gauge) GetValue

func (m *Gauge) GetValue() float64

func (*Gauge) Marshal

func (m *Gauge) Marshal() (dAtA []byte, err error)

func (*Gauge) MarshalTo

func (m *Gauge) MarshalTo(dAtA []byte) (int, error)

func (*Gauge) MarshalToSizedBuffer

func (m *Gauge) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Gauge) ProtoMessage

func (*Gauge) ProtoMessage()

func (*Gauge) Reset

func (m *Gauge) Reset()

func (*Gauge) Size

func (m *Gauge) Size() (n int)

func (*Gauge) String

func (m *Gauge) String() string

func (*Gauge) Unmarshal

func (m *Gauge) Unmarshal(dAtA []byte) error

func (*Gauge) XXX_DiscardUnknown

func (m *Gauge) XXX_DiscardUnknown()

func (*Gauge) XXX_Marshal

func (m *Gauge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Gauge) XXX_Merge

func (m *Gauge) XXX_Merge(src proto.Message)

func (*Gauge) XXX_Size

func (m *Gauge) XXX_Size() int

func (*Gauge) XXX_Unmarshal

func (m *Gauge) XXX_Unmarshal(b []byte) error

type LabelPair

type LabelPair struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func P2MLabelPairs

func P2MLabelPairs(lbls []*dto.LabelPair) []*LabelPair

func (*LabelPair) Descriptor

func (*LabelPair) Descriptor() ([]byte, []int)

func (*LabelPair) GetName

func (m *LabelPair) GetName() string

func (*LabelPair) GetValue

func (m *LabelPair) GetValue() string

func (*LabelPair) Marshal

func (m *LabelPair) Marshal() (dAtA []byte, err error)

func (*LabelPair) MarshalTo

func (m *LabelPair) MarshalTo(dAtA []byte) (int, error)

func (*LabelPair) MarshalToSizedBuffer

func (m *LabelPair) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LabelPair) ProtoMessage

func (*LabelPair) ProtoMessage()

func (*LabelPair) Reset

func (m *LabelPair) Reset()

func (*LabelPair) Size

func (m *LabelPair) Size() (n int)

func (*LabelPair) String

func (m *LabelPair) String() string

func (*LabelPair) Unmarshal

func (m *LabelPair) Unmarshal(dAtA []byte) error

func (*LabelPair) XXX_DiscardUnknown

func (m *LabelPair) XXX_DiscardUnknown()

func (*LabelPair) XXX_Marshal

func (m *LabelPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LabelPair) XXX_Merge

func (m *LabelPair) XXX_Merge(src proto.Message)

func (*LabelPair) XXX_Size

func (m *LabelPair) XXX_Size() int

func (*LabelPair) XXX_Unmarshal

func (m *LabelPair) XXX_Unmarshal(b []byte) error

type Metric

type Metric struct {
	Label                []*LabelPair `protobuf:"bytes,1,rep,name=label,proto3" json:"label,omitempty"`
	Gauge                *Gauge       `protobuf:"bytes,2,opt,name=gauge,proto3" json:"gauge,omitempty"`
	Counter              *Counter     `protobuf:"bytes,3,opt,name=counter,proto3" json:"counter,omitempty"`
	RawHist              *RawHist     `protobuf:"bytes,4,opt,name=rawHist,proto3" json:"rawHist,omitempty"`
	Collecttime          int64        `protobuf:"varint,5,opt,name=collecttime,proto3" json:"collecttime,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func P2MCounters

func P2MCounters(ms []*dto.Metric) []*Metric

func P2MGauges

func P2MGauges(ms []*dto.Metric) []*Metric

func (*Metric) Descriptor

func (*Metric) Descriptor() ([]byte, []int)

func (*Metric) GetCollecttime

func (m *Metric) GetCollecttime() int64

func (*Metric) GetCounter

func (m *Metric) GetCounter() *Counter

func (*Metric) GetGauge

func (m *Metric) GetGauge() *Gauge

func (*Metric) GetLabel

func (m *Metric) GetLabel() []*LabelPair

func (*Metric) GetRawHist

func (m *Metric) GetRawHist() *RawHist

func (*Metric) Marshal

func (m *Metric) Marshal() (dAtA []byte, err error)

func (*Metric) MarshalTo

func (m *Metric) MarshalTo(dAtA []byte) (int, error)

func (*Metric) MarshalToSizedBuffer

func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) Reset

func (m *Metric) Reset()

func (*Metric) Size

func (m *Metric) Size() (n int)

func (*Metric) String

func (m *Metric) String() string

func (*Metric) Unmarshal

func (m *Metric) Unmarshal(dAtA []byte) error

func (*Metric) XXX_DiscardUnknown

func (m *Metric) XXX_DiscardUnknown()

func (*Metric) XXX_Marshal

func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Metric) XXX_Merge

func (m *Metric) XXX_Merge(src proto.Message)

func (*Metric) XXX_Size

func (m *Metric) XXX_Size() int

func (*Metric) XXX_Unmarshal

func (m *Metric) XXX_Unmarshal(b []byte) error

type MetricFamily

type MetricFamily struct {
	Name                 string     `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Help                 string     `protobuf:"bytes,2,opt,name=help,proto3" json:"help,omitempty"`
	Type                 MetricType `protobuf:"varint,3,opt,name=type,proto3,enum=metric.MetricType" json:"type,omitempty"`
	Metric               []*Metric  `protobuf:"bytes,4,rep,name=metric,proto3" json:"metric,omitempty"`
	Node                 string     `protobuf:"bytes,5,opt,name=node,proto3" json:"node,omitempty"`
	Role                 string     `protobuf:"bytes,6,opt,name=role,proto3" json:"role,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func P2MMetricFamilies

func P2MMetricFamilies(mfs []*dto.MetricFamily) []*MetricFamily

func (*MetricFamily) Descriptor

func (*MetricFamily) Descriptor() ([]byte, []int)

func (*MetricFamily) GetHelp

func (m *MetricFamily) GetHelp() string

func (*MetricFamily) GetMetric

func (m *MetricFamily) GetMetric() []*Metric

func (*MetricFamily) GetName

func (m *MetricFamily) GetName() string

func (*MetricFamily) GetNode

func (m *MetricFamily) GetNode() string

func (*MetricFamily) GetRole

func (m *MetricFamily) GetRole() string

func (*MetricFamily) GetType

func (m *MetricFamily) GetType() MetricType

func (*MetricFamily) Marshal

func (m *MetricFamily) Marshal() (dAtA []byte, err error)

func (*MetricFamily) MarshalTo

func (m *MetricFamily) MarshalTo(dAtA []byte) (int, error)

func (*MetricFamily) MarshalToSizedBuffer

func (m *MetricFamily) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MetricFamily) ProtoMessage

func (*MetricFamily) ProtoMessage()

func (*MetricFamily) Reset

func (m *MetricFamily) Reset()

func (*MetricFamily) Size

func (m *MetricFamily) Size() (n int)

func (*MetricFamily) String

func (m *MetricFamily) String() string

func (*MetricFamily) Unmarshal

func (m *MetricFamily) Unmarshal(dAtA []byte) error

func (*MetricFamily) XXX_DiscardUnknown

func (m *MetricFamily) XXX_DiscardUnknown()

func (*MetricFamily) XXX_Marshal

func (m *MetricFamily) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MetricFamily) XXX_Merge

func (m *MetricFamily) XXX_Merge(src proto.Message)

func (*MetricFamily) XXX_Size

func (m *MetricFamily) XXX_Size() int

func (*MetricFamily) XXX_Unmarshal

func (m *MetricFamily) XXX_Unmarshal(b []byte) error

type MetricType

type MetricType int32
const (
	MetricType_COUNTER MetricType = 0
	MetricType_GAUGE   MetricType = 1
	MetricType_RAWHIST MetricType = 2
)

func (MetricType) EnumDescriptor

func (MetricType) EnumDescriptor() ([]byte, []int)

func (MetricType) String

func (x MetricType) String() string

type RawHist

type RawHist struct {
	Samples              []*Sample `protobuf:"bytes,1,rep,name=samples,proto3" json:"samples,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*RawHist) Descriptor

func (*RawHist) Descriptor() ([]byte, []int)

func (*RawHist) GetSamples

func (m *RawHist) GetSamples() []*Sample

func (*RawHist) Marshal

func (m *RawHist) Marshal() (dAtA []byte, err error)

func (*RawHist) MarshalTo

func (m *RawHist) MarshalTo(dAtA []byte) (int, error)

func (*RawHist) MarshalToSizedBuffer

func (m *RawHist) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RawHist) ProtoMessage

func (*RawHist) ProtoMessage()

func (*RawHist) Reset

func (m *RawHist) Reset()

func (*RawHist) Size

func (m *RawHist) Size() (n int)

func (*RawHist) String

func (m *RawHist) String() string

func (*RawHist) Unmarshal

func (m *RawHist) Unmarshal(dAtA []byte) error

func (*RawHist) XXX_DiscardUnknown

func (m *RawHist) XXX_DiscardUnknown()

func (*RawHist) XXX_Marshal

func (m *RawHist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RawHist) XXX_Merge

func (m *RawHist) XXX_Merge(src proto.Message)

func (*RawHist) XXX_Size

func (m *RawHist) XXX_Size() int

func (*RawHist) XXX_Unmarshal

func (m *RawHist) XXX_Unmarshal(b []byte) error

type Sample

type Sample struct {
	Datetime             int64    `protobuf:"varint,1,opt,name=datetime,proto3" json:"datetime,omitempty"`
	Value                float64  `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Sample) Descriptor

func (*Sample) Descriptor() ([]byte, []int)

func (*Sample) GetDatetime

func (m *Sample) GetDatetime() int64

func (*Sample) GetValue

func (m *Sample) GetValue() float64

func (*Sample) Marshal

func (m *Sample) Marshal() (dAtA []byte, err error)

func (*Sample) MarshalTo

func (m *Sample) MarshalTo(dAtA []byte) (int, error)

func (*Sample) MarshalToSizedBuffer

func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Sample) ProtoMessage

func (*Sample) ProtoMessage()

func (*Sample) Reset

func (m *Sample) Reset()

func (*Sample) Size

func (m *Sample) Size() (n int)

func (*Sample) String

func (m *Sample) String() string

func (*Sample) Unmarshal

func (m *Sample) Unmarshal(dAtA []byte) error

func (*Sample) XXX_DiscardUnknown

func (m *Sample) XXX_DiscardUnknown()

func (*Sample) XXX_Marshal

func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Sample) XXX_Merge

func (m *Sample) XXX_Merge(src proto.Message)

func (*Sample) XXX_Size

func (m *Sample) XXX_Size() int

func (*Sample) XXX_Unmarshal

func (m *Sample) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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