types

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sample

type Sample struct {
	Metric    string            `json:"metric"`
	Value     model.SampleValue `json:"value"`
	Labels    model.LabelSet    `json:"labels"`
	Timestamp time.Time         `json:"timestamp"`
}

func NewSample

func NewSample(metric string, value model.SampleValue, labels ...map[string]string) *Sample

NewSample creates a new Sample

func SetTimestamps

func SetTimestamps(now time.Time, samples []*Sample) []*Sample

func (*Sample) ConvertTimeSeries

func (sample *Sample) ConvertTimeSeries() prompb.TimeSeries

ConvertTimeSeries converts a prometheus TimeSeries to a Sample

func (*Sample) SetTimestamp

func (sample *Sample) SetTimestamp(timestamp time.Time)

Jump to

Keyboard shortcuts

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