Documentation ¶
Overview ¶
Package ts is a generated GoMock package.
Index ¶
- type AlignedDatapoints
- type Datapoint
- type Datapoints
- func (d Datapoints) AlignToBounds(bounds models.Bounds, lookbackDuration time.Duration, buffer AlignedDatapoints) AlignedDatapoints
- func (d Datapoints) AlignToBoundsNoWriteForward(bounds models.Bounds, lookbackDuration time.Duration, buffer AlignedDatapoints) AlignedDatapoints
- func (d Datapoints) DatapointAt(n int) Datapoint
- func (d Datapoints) Datapoints() []Datapoint
- func (d Datapoints) Len() int
- func (d Datapoints) Reset(values []float64) []float64
- func (d Datapoints) ValueAt(n int) float64
- func (d Datapoints) Values() []float64
- type FixedResolutionMutableValues
- type Metadata
- type MetricType
- type MockValues
- func (m *MockValues) AlignToBounds(arg0 models.Bounds, arg1 time.Duration, arg2 AlignedDatapoints) AlignedDatapoints
- func (m *MockValues) AlignToBoundsNoWriteForward(arg0 models.Bounds, arg1 time.Duration, arg2 AlignedDatapoints) AlignedDatapoints
- func (m *MockValues) DatapointAt(arg0 int) Datapoint
- func (m *MockValues) Datapoints() []Datapoint
- func (m *MockValues) EXPECT() *MockValuesMockRecorder
- func (m *MockValues) Len() int
- func (m *MockValues) ValueAt(arg0 int) float64
- type MockValuesMockRecorder
- func (mr *MockValuesMockRecorder) AlignToBounds(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockValuesMockRecorder) AlignToBoundsNoWriteForward(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockValuesMockRecorder) DatapointAt(arg0 interface{}) *gomock.Call
- func (mr *MockValuesMockRecorder) Datapoints() *gomock.Call
- func (mr *MockValuesMockRecorder) Len() *gomock.Call
- func (mr *MockValuesMockRecorder) ValueAt(arg0 interface{}) *gomock.Call
- type MutableValues
- type Series
- type SeriesAttributes
- type SeriesList
- type SourceType
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlignedDatapoints ¶ added in v0.15.0
type AlignedDatapoints []Datapoints
AlignedDatapoints is a list of aligned datapoints.
type Datapoints ¶
type Datapoints []Datapoint
Datapoints is a list of datapoints.
func (Datapoints) AlignToBounds ¶ added in v0.4.6
func (d Datapoints) AlignToBounds( bounds models.Bounds, lookbackDuration time.Duration, buffer AlignedDatapoints, ) AlignedDatapoints
AlignToBounds returns values aligned to given bounds. To belong to a step, values should be <= stepTime and not stale.
func (Datapoints) AlignToBoundsNoWriteForward ¶ added in v0.6.0
func (d Datapoints) AlignToBoundsNoWriteForward( bounds models.Bounds, lookbackDuration time.Duration, buffer AlignedDatapoints, ) AlignedDatapoints
AlignToBoundsNoWriteForward returns values aligned to the start time and duration, but does not write points forward after aligning them. This differs from AlignToBounds which will write points forwards if no additional values are found in the values, adding an empty point instead.
func (Datapoints) DatapointAt ¶
func (d Datapoints) DatapointAt(n int) Datapoint
DatapointAt returns the value at the nth element.
func (Datapoints) Datapoints ¶ added in v0.4.6
func (d Datapoints) Datapoints() []Datapoint
Datapoints returns all the datapoints.
func (Datapoints) Reset ¶ added in v0.15.0
func (d Datapoints) Reset(values []float64) []float64
Reset resets the passed in value slice with the current value representation.
func (Datapoints) ValueAt ¶
func (d Datapoints) ValueAt(n int) float64
ValueAt returns the value at the nth element.
func (Datapoints) Values ¶ added in v0.4.6
func (d Datapoints) Values() []float64
Values returns the values representation.
type FixedResolutionMutableValues ¶
type FixedResolutionMutableValues interface { MutableValues Resolution() time.Duration StepAtTime(t time.Time) int StartTimeForStep(n int) time.Time // Time when the series starts StartTime() time.Time }
FixedResolutionMutableValues are mutable values with fixed resolution between steps
func NewFixedStepValues ¶
func NewFixedStepValues( resolution time.Duration, numSteps int, initialValue float64, startTime time.Time, ) FixedResolutionMutableValues
NewFixedStepValues returns mutable values with fixed resolution TODO: remove this.
type Metadata ¶ added in v0.15.3
type Metadata struct {
DropUnaggregated bool
}
Metadata is metadata associated with a time series.
type MetricType ¶ added in v0.15.0
type MetricType int
MetricType is the enum for metric types.
const ( // MetricTypeGauge is the gauge metric type. MetricTypeGauge MetricType = iota // MetricTypeCounter is the counter metric type. MetricTypeCounter // MetricTypeTimer is the timer metric type. MetricTypeTimer )
type MockValues ¶ added in v0.10.0
type MockValues struct {
// contains filtered or unexported fields
}
MockValues is a mock of Values interface
func NewMockValues ¶ added in v0.10.0
func NewMockValues(ctrl *gomock.Controller) *MockValues
NewMockValues creates a new mock instance
func (*MockValues) AlignToBounds ¶ added in v0.10.0
func (m *MockValues) AlignToBounds(arg0 models.Bounds, arg1 time.Duration, arg2 AlignedDatapoints) AlignedDatapoints
AlignToBounds mocks base method
func (*MockValues) AlignToBoundsNoWriteForward ¶ added in v0.10.0
func (m *MockValues) AlignToBoundsNoWriteForward(arg0 models.Bounds, arg1 time.Duration, arg2 AlignedDatapoints) AlignedDatapoints
AlignToBoundsNoWriteForward mocks base method
func (*MockValues) DatapointAt ¶ added in v0.10.0
func (m *MockValues) DatapointAt(arg0 int) Datapoint
DatapointAt mocks base method
func (*MockValues) Datapoints ¶ added in v0.10.0
func (m *MockValues) Datapoints() []Datapoint
Datapoints mocks base method
func (*MockValues) EXPECT ¶ added in v0.10.0
func (m *MockValues) EXPECT() *MockValuesMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockValues) ValueAt ¶ added in v0.10.0
func (m *MockValues) ValueAt(arg0 int) float64
ValueAt mocks base method
type MockValuesMockRecorder ¶ added in v0.10.0
type MockValuesMockRecorder struct {
// contains filtered or unexported fields
}
MockValuesMockRecorder is the mock recorder for MockValues
func (*MockValuesMockRecorder) AlignToBounds ¶ added in v0.10.0
func (mr *MockValuesMockRecorder) AlignToBounds(arg0, arg1, arg2 interface{}) *gomock.Call
AlignToBounds indicates an expected call of AlignToBounds
func (*MockValuesMockRecorder) AlignToBoundsNoWriteForward ¶ added in v0.10.0
func (mr *MockValuesMockRecorder) AlignToBoundsNoWriteForward(arg0, arg1, arg2 interface{}) *gomock.Call
AlignToBoundsNoWriteForward indicates an expected call of AlignToBoundsNoWriteForward
func (*MockValuesMockRecorder) DatapointAt ¶ added in v0.10.0
func (mr *MockValuesMockRecorder) DatapointAt(arg0 interface{}) *gomock.Call
DatapointAt indicates an expected call of DatapointAt
func (*MockValuesMockRecorder) Datapoints ¶ added in v0.10.0
func (mr *MockValuesMockRecorder) Datapoints() *gomock.Call
Datapoints indicates an expected call of Datapoints
func (*MockValuesMockRecorder) Len ¶ added in v0.10.0
func (mr *MockValuesMockRecorder) Len() *gomock.Call
Len indicates an expected call of Len
func (*MockValuesMockRecorder) ValueAt ¶ added in v0.10.0
func (mr *MockValuesMockRecorder) ValueAt(arg0 interface{}) *gomock.Call
ValueAt indicates an expected call of ValueAt
type MutableValues ¶
type MutableValues interface { Values // Sets the value at the given entry SetValueAt(n int, v float64) }
MutableValues is the interface for values that can be updated
type Series ¶
Series is the public interface to a block of timeseries values. Each block has a start time, a logical number of steps, and a step size indicating the number of milliseconds represented by each point.
func NewSeries ¶
NewSeries creates a new Series at a given start time, backed by the provided values.
type SeriesAttributes ¶ added in v0.15.0
type SeriesAttributes struct { Type MetricType Source SourceType }
SeriesAttributes has attributes about the time series.
func DefaultSeriesAttributes ¶ added in v0.15.0
func DefaultSeriesAttributes() SeriesAttributes
DefaultSeriesAttributes returns a default series attributes.
type SourceType ¶ added in v0.15.0
type SourceType int
SourceType is the enum for metric source types.
const ( // SourceTypePrometheus is the prometheus source type. SourceTypePrometheus SourceType = iota // SourceTypeGraphite is the graphite source type. SourceTypeGraphite )
type Values ¶
type Values interface { // Len returns the number of values present Len() int // ValueAt returns the value at the nth element ValueAt(n int) float64 // DatapointAt returns the datapoint at the nth element DatapointAt(n int) Datapoint // Datapoints returns all the datapoints Datapoints() []Datapoint // AlignToBounds returns values aligned to given bounds. To belong to a step, // values should be <= stepTime and not stale. Takes an optional buffer to // allow for memory re-use. AlignToBounds( bounds models.Bounds, lookbackDuration time.Duration, buffer AlignedDatapoints, ) AlignedDatapoints // AlignToBoundsNoWriteForward returns values aligned to the start time // and duration, but does not write points forward after aligning them. This // differs from AlignToBounds which will write points forwards if no // additional values are found in the values, adding an empty point instead. // Takes an optional buffer to allow for memory re-use. AlignToBoundsNoWriteForward( bounds models.Bounds, lookbackDuration time.Duration, buffer AlignedDatapoints, ) AlignedDatapoints }
Values holds the values for a timeseries. It provides a minimal interface for storing and retrieving values in the series, with Series providing a more convenient interface for applications to build on top of. Values objects are not specific to a given time, allowing them to be pre-allocated, pooled, and re-used across multiple series. There are multiple implementations of Values so that we can optimize storage based on the density of the series.