Documentation ¶
Index ¶
- Variables
- func LongFrameVersions() []data.FrameTypeVersion
- func MultiFrameVersions() []data.FrameTypeVersion
- func WideFrameVersions() []data.FrameTypeVersion
- type Collection
- type CollectionReader
- type LongFrame
- type MetricRef
- func (m MetricRef) GetLabels() data.Labels
- func (m MetricRef) GetMetricName() string
- func (m MetricRef) Len() (int, error)
- func (m MetricRef) NullableFloat64Point(pointIdx int) (time.Time, *float64, error)
- func (m MetricRef) NullableFloat64Value(pointIdx int) (*float64, error)
- func (m MetricRef) Time(pointIdx int) (time.Time, error)
- type MultiFrame
- func (mfs *MultiFrame) AddSeries(metricName string, l data.Labels, t []time.Time, values interface{}) error
- func (mfs *MultiFrame) Frames() data.Frames
- func (mfs *MultiFrame) GetCollection(validateData bool) (Collection, error)
- func (mfs *MultiFrame) SetMetricMD(metricName string, l data.Labels, fc data.FieldConfig)
- type WideFrame
- func (wf *WideFrame) AddSeries(metricName string, values interface{}, l data.Labels, config *data.FieldConfig) error
- func (wf *WideFrame) Frames() data.Frames
- func (wf *WideFrame) GetCollection(validateData bool) (Collection, error)
- func (wf *WideFrame) SetMetricMD(metricName string, l data.Labels, fc data.FieldConfig)
- func (wf *WideFrame) SetTime(timeName string, t []time.Time) error
Constants ¶
This section is empty.
Variables ¶
var LongFrameVersionLatest = LongFrameVersions()[len(LongFrameVersions())-1]
var MultiFrameVersionLatest = MultiFrameVersions()[len(MultiFrameVersions())-1]
var WideFrameVersionLatest = WideFrameVersions()[len(WideFrameVersions())-1]
Functions ¶
func LongFrameVersions ¶
func LongFrameVersions() []data.FrameTypeVersion
func MultiFrameVersions ¶
func MultiFrameVersions() []data.FrameTypeVersion
func WideFrameVersions ¶
func WideFrameVersions() []data.FrameTypeVersion
Types ¶
type Collection ¶
type Collection struct { RefID string Refs []MetricRef RemainderIndices []sdata.FrameFieldIndex Warning error }
func (Collection) NoData ¶ added in v0.0.5
func (c Collection) NoData() bool
type CollectionReader ¶
type CollectionReader interface { // GetCollection runs validate without validateData. If the data is valid, then // []TimeSeriesMetricRef is returned from reading as well as any ignored data. If invalid, // then an error is returned, and no refs or ignoredFieldIndices are returned. GetCollection(validateData bool) (Collection, error) Frames() data.Frames // returns underlying frames }
func CollectionReaderFromFrames ¶
func CollectionReaderFromFrames(frames []*data.Frame) (CollectionReader, error)
type LongFrame ¶
LongFrame is a time series format where all series live in one frame. This time series format should be used with Table-like sources (e.g. SQL) that do not have a native concept of Labels.
func NewLongFrame ¶
func NewLongFrame(refID string, v data.FrameTypeVersion) (*LongFrame, error)
func (*LongFrame) GetCollection ¶
func (ls *LongFrame) GetCollection(validateData bool) (Collection, error)
type MetricRef ¶
MetricRef is for reading and contains the data for an individual time series. In the cases of the Multi and Wide formats, the Fields are pointers to the data in the original frame. In the case of Long new fields are constructed.
func (MetricRef) GetMetricName ¶
func (MetricRef) NullableFloat64Point ¶
NullableFloat64Point returns the time and *float64 value at the specified index. It will error if the index is out of bounds, or if the value can not be converted to a *float64.
func (MetricRef) NullableFloat64Value ¶
type MultiFrame ¶
MultiFrame is a time series format where each series lives in its own single frame. This time series format should be use for data that natively uses Labels and when all of the series are not guaranteed to have identical time values.
func LongToMulti ¶ added in v0.0.7
func LongToMulti(longFrame *LongFrame) (*MultiFrame, error)
LongToMulti converts a LongFrame into a MultiFrame and returns an error if it fails to parse the LongFrame.
func NewMultiFrame ¶
func NewMultiFrame(refID string, v data.FrameTypeVersion) (*MultiFrame, error)
NewMultiFrame creates an empty MultiFrame formatted time series. This function must be called before the AddSeries Method. The returned MultiFrame is a valid typed data response that corresponds to "No Data".
func (*MultiFrame) AddSeries ¶
func (mfs *MultiFrame) AddSeries(metricName string, l data.Labels, t []time.Time, values interface{}) error
values must be a numeric slice such as []int64, []float64, []*float64, etc or []bool / []*bool.
func (*MultiFrame) Frames ¶
func (mfs *MultiFrame) Frames() data.Frames
func (*MultiFrame) GetCollection ¶
func (mfs *MultiFrame) GetCollection(validateData bool) (Collection, error)
func (*MultiFrame) SetMetricMD ¶
func (mfs *MultiFrame) SetMetricMD(metricName string, l data.Labels, fc data.FieldConfig)
type WideFrame ¶
WideFrame is a time series format where all the series live in one frame. This time series format should be use for data that natively uses Labels and when all of the series are guaranteed to have identical time values.
func NewWideFrame ¶
func NewWideFrame(refID string, v data.FrameTypeVersion) (*WideFrame, error)
func (*WideFrame) GetCollection ¶
func (wf *WideFrame) GetCollection(validateData bool) (Collection, error)