tsdbtest

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TsdbDefaultTestConfigPath = "testdata"
View Source
const V3ioConfigEnvironmentVariable = "V3IO_CONF"

Variables

This section is empty.

Functions

func CreateSchema

func CreateSchema(t testing.TB, agg string) config.Schema

func CreateTestTSDB

func CreateTestTSDB(t testing.TB, v3ioConfig *config.V3ioConfig)

func DeleteTSDB

func DeleteTSDB(t testing.TB, v3ioConfig *config.V3ioConfig)

func GetV3ioConfigPath

func GetV3ioConfigPath() (string, error)

This method will try and load the configuration file from several locations by the following order: 1. Environment variable named 'V3IO_CONF' 2. Current package's 'testdata/v3io.yaml' folder 3. $GOPATH/src/github.com/v3io/v3io-tsdb/v3io.yaml

func InsertData

func InsertData(t *testing.T, v3ioConfig *config.V3ioConfig, metricName string, data []DataPoint, userLabels utils.Labels) *V3ioAdapter

func LoadV3ioConfig

func LoadV3ioConfig() (*config.V3ioConfig, error)

func NormalizePath

func NormalizePath(path string) string

func SetUp

func SetUp(t testing.TB, v3ioConfig *config.V3ioConfig) func()

func SetUpWithDBConfig

func SetUpWithDBConfig(t *testing.T, v3ioConfig *config.V3ioConfig, schema *config.Schema) func()

func SetUpWithData

func SetUpWithData(t *testing.T, v3ioConfig *config.V3ioConfig, metricName string, data []DataPoint, userLabels utils.Labels) (*V3ioAdapter, func())

func ValidateCountOfSamples

func ValidateCountOfSamples(t testing.TB, adapter *V3ioAdapter, metricName string, expected int, startTimeMs, endTimeMs int64)

Types

type DataPoint

type DataPoint struct {
	Time  int64
	Value float64
}

type DataPointTimeSorter

type DataPointTimeSorter []DataPoint

DataPointTimeSorter sorts DataPoints by time

func (DataPointTimeSorter) Len

func (a DataPointTimeSorter) Len() int

func (DataPointTimeSorter) Less

func (a DataPointTimeSorter) Less(i, j int) bool

func (DataPointTimeSorter) Swap

func (a DataPointTimeSorter) Swap(i, j int)

type Sample

type Sample struct {
	Lset  utils.Labels
	Time  string
	Value float64
}

Jump to

Keyboard shortcuts

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