prompbmarshal

package
v0.34.0-victorialogs Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Label

type Label struct {
	Name  string
	Value string
}

func (*Label) MarshalToSizedBuffer

func (m *Label) MarshalToSizedBuffer(dst []byte) (int, error)

func (*Label) Size

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

type Sample

type Sample struct {
	Value     float64
	Timestamp int64
}

func (*Sample) MarshalToSizedBuffer

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

func (*Sample) Size

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

type TimeSeries

type TimeSeries struct {
	Labels  []Label
	Samples []Sample
}

TimeSeries represents samples and labels for a single time series.

func MustParsePromMetrics added in v1.97.7

func MustParsePromMetrics(s string, offsetMsecs int64) []TimeSeries

MustParsePromMetrics parses metrics in Prometheus text exposition format from s and returns them.

Metrics must be delimited with newlines.

offsetMsecs is added to every timestamp in parsed metrics.

This function is for testing purposes only. Do not use it in non-test code.

func ResetTimeSeries added in v1.35.4

func ResetTimeSeries(tss []TimeSeries) []TimeSeries

ResetTimeSeries clears all the GC references from tss and returns an empty tss ready for further use.

func (*TimeSeries) MarshalToSizedBuffer

func (m *TimeSeries) MarshalToSizedBuffer(dst []byte) (int, error)

func (*TimeSeries) Size

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

type WriteRequest

type WriteRequest struct {
	Timeseries []TimeSeries
}

func (*WriteRequest) MarshalProtobuf added in v1.97.0

func (wr *WriteRequest) MarshalProtobuf(dst []byte) []byte

MarshalProtobuf marshals wr to dst and returns the result.

func (*WriteRequest) MarshalToSizedBuffer

func (m *WriteRequest) MarshalToSizedBuffer(dst []byte) (int, error)

func (*WriteRequest) Reset added in v1.97.0

func (wr *WriteRequest) Reset()

Reset resets wr.

func (*WriteRequest) Size

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

Jump to

Keyboard shortcuts

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