numeric

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

View Source
const FrameTypeNumericLong = "numeric_long"
View Source
const FrameTypeNumericWide = "numeric_wide"

Variables

View Source
var LongFrameVersionLatest = LongFrameVersions()[len(LongFrameVersions())-1]
View Source
var MultiFrameVersionLatest = MultiFrameVersions()[len(MultiFrameVersions())-1]
View Source
var WideFrameVersionLatest = WideFrameVersions()[len(WideFrameVersions())-1]

Functions

func LongFrameVersions

func LongFrameVersions() []data.FrameTypeVersion

func MultiFrameVersions

func MultiFrameVersions() []data.FrameTypeVersion

func SortNumericMetricRef added in v0.0.8

func SortNumericMetricRef(refs []MetricRef)

func WideFrameVersions

func WideFrameVersions() []data.FrameTypeVersion

Types

type Collection

type Collection struct {
	RefID            string
	Refs             []MetricRef
	RemainderIndices []sdata.FrameFieldIndex // TODO: Currently not populated
	Warning          error
}

func (Collection) NoData added in v0.0.5

func (c Collection) NoData() bool

type CollectionRW

type CollectionRW interface {
	CollectionWriter
	CollectionReader
}

type CollectionReader

type CollectionReader interface {
	GetCollection(validateData bool) (Collection, error)

	Frames() data.Frames
}

func CollectionReaderFromFrames

func CollectionReaderFromFrames(frames []*data.Frame) (CollectionReader, error)

type CollectionWriter

type CollectionWriter interface {
	AddMetric(metricName string, l data.Labels, value interface{}) error
	SetMetricMD(metricName string, l data.Labels, fc data.FieldConfig)
}

type LongFrame

type LongFrame struct {
	*data.Frame
}

func NewLongFrame

func NewLongFrame(refID string, v data.FrameTypeVersion) (*LongFrame, error)

func (*LongFrame) Frames

func (lf *LongFrame) Frames() data.Frames

func (*LongFrame) GetCollection

func (lf *LongFrame) GetCollection(validateData bool) (Collection, error)

type MetricRef

type MetricRef struct {
	ValueField *data.Field
}

func (MetricRef) GetLabels

func (n MetricRef) GetLabels() data.Labels

func (MetricRef) GetMetricName

func (n MetricRef) GetMetricName() string

func (MetricRef) NullableFloat64Value

func (n MetricRef) NullableFloat64Value() (*float64, bool, error)

FloatValue returns the *float64 of the value, a bool that is true if the value is empty (no field, or zero length field) and an error if the field can not be converted to a *float64.

type MultiFrame

type MultiFrame []*data.Frame

func NewMultiFrame

func NewMultiFrame(refID string, v data.FrameTypeVersion) (*MultiFrame, error)

func (*MultiFrame) AddMetric

func (mf *MultiFrame) AddMetric(metricName string, l data.Labels, value interface{}) error

func (*MultiFrame) Frames

func (mf *MultiFrame) Frames() data.Frames

func (*MultiFrame) GetCollection

func (mf *MultiFrame) GetCollection(validateData bool) (Collection, error)

func (*MultiFrame) SetMetricMD

func (mf *MultiFrame) SetMetricMD(metricName string, l data.Labels, fc data.FieldConfig)

type WideFrame

type WideFrame struct {
	*data.Frame
}

func NewWideFrame

func NewWideFrame(refID string, v data.FrameTypeVersion) (*WideFrame, error)

func (*WideFrame) AddMetric

func (wf *WideFrame) AddMetric(metricName string, l data.Labels, value interface{}) error

func (*WideFrame) Frames

func (wf *WideFrame) Frames() data.Frames

func (*WideFrame) GetCollection

func (wf *WideFrame) GetCollection(validateData bool) (Collection, error)

func (*WideFrame) SetMetricMD

func (wf *WideFrame) SetMetricMD(metricName string, l data.Labels, fc data.FieldConfig)

func (*WideFrame) Validate

func (wf *WideFrame) Validate() (isEmpty bool, errors []error)

Jump to

Keyboard shortcuts

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