tsdbtest

package
v0.10.9 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DaysInMillis = 24 * HoursInMillis
View Source
const HoursInMillis = 60 * MinuteInMillis
View Source
const MinuteInMillis = 60 * 1000
View Source
const OptDropTableOnTearDown = "DropTableOnTearDown"
View Source
const OptIgnoreReason = "IgnoreReason"
View Source
const OptTimeSeries = "TimeSeries"
View Source
const OptV3ioConfig = "V3ioConfig"
View Source
const TsdbDefaultTestConfigPath = "testdata"

Variables

This section is empty.

Functions

func CreateTestTSDB

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

func CreateTestTSDBWithAggregates added in v0.8.0

func CreateTestTSDBWithAggregates(t testing.TB, v3ioConfig *config.V3ioConfig, aggregates string)

func DateStringToMillis added in v0.8.9

func DateStringToMillis(date string) (int64, error)

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_TSDB_CONFIG' 2. Current package's 'testdata/v3io-tsdb-config.yaml' folder 3. $GOPATH/src/github.com/v3io/v3io-tsdb/v3io-tsdb-config.yaml

func InsertData

func InsertData(t *testing.T, testParams TestParams) *V3ioAdapter

func LoadV3ioConfig

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

func NanosToMillis added in v0.8.3

func NanosToMillis(nanos int64) int64

func NormalizePath

func NormalizePath(path string) string

func PrefixTablePath added in v0.0.13

func PrefixTablePath(tablePath string) string

func SetUp

func SetUp(t testing.TB, testParams TestParams) func()

func SetUpWithDBConfig

func SetUpWithDBConfig(t *testing.T, schema *config.Schema, testParams TestParams) func()

func SetUpWithData

func SetUpWithData(t *testing.T, testOpts TestParams) (*V3ioAdapter, func())

func ValidateCountOfSamples

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

func ValidateRawData added in v0.0.12

func ValidateRawData(t testing.TB, adapter *V3ioAdapter, metricName string, startTimeMs, endTimeMs int64, isValid func(*DataPoint, *DataPoint) bool)

Types

type DataPoint

type DataPoint struct {
	Time  int64
	Value interface{}
}

func IteratorToSlice added in v0.8.3

func IteratorToSlice(it chunkenc.Iterator) ([]DataPoint, error)

func (DataPoint) Equals added in v0.9.14

func (dp DataPoint) Equals(other DataPoint) bool

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 Metric added in v0.8.3

type Metric struct {
	Name          string
	Labels        utils.Labels
	Data          []DataPoint
	ExpectedCount *int
}

type Sample

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

type TestOption added in v0.8.3

type TestOption struct {
	Key   string
	Value interface{}
}

type TestParams added in v0.8.3

type TestParams map[string]interface{}

func NewTestParams added in v0.8.3

func NewTestParams(t testing.TB, opts ...TestOption) TestParams

func (TestParams) DropTableOnTearDown added in v0.8.3

func (tp TestParams) DropTableOnTearDown() bool

func (TestParams) IgnoreReason added in v0.8.3

func (tp TestParams) IgnoreReason() string

func (TestParams) TimeSeries added in v0.8.3

func (tp TestParams) TimeSeries() TimeSeries

func (TestParams) V3ioConfig added in v0.8.3

func (tp TestParams) V3ioConfig() *config.V3ioConfig

type TimeSeries added in v0.8.3

type TimeSeries []Metric

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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