Documentation ¶
Index ¶
- Constants
- func CreateBlockFromHead(t testing.TB, dir string, head *tsdb.Head) ulid.ULID
- func CreateHeadWithSeries(t testing.TB, j int, opts HeadGenOptions) (*tsdb.Head, []*storepb.Series)
- func ReadSeriesFromBlock(t testing.TB, h tsdb.BlockReader, extLabels labels.Labels, skipChunks bool) []*storepb.Series
- func RunSeriesInterestingCases(t testutil.TB, maxSamples, maxSeries int, ...)
- func TestServerSeries(t testutil.TB, store storepb.StoreServer, cases ...*SeriesCase)
- type HeadGenOptions
- type SeriesCase
- type SeriesServer
- type StoreSeriesClient
- type TestClient
- func (c TestClient) Addr() (string, bool)
- func (c TestClient) LabelSets() []labels.Labels
- func (c TestClient) String() string
- func (c TestClient) SupportsSharding() bool
- func (c TestClient) SupportsWithoutReplicaLabels() bool
- func (c TestClient) TSDBInfos() []infopb.TSDBInfo
- func (c TestClient) TimeRange() (mint, maxt int64)
Constants ¶
View Source
const (
// LabelLongSuffix is a label with ~50B in size, to emulate real-world high cardinality.
LabelLongSuffix = "aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd"
)
Variables ¶
This section is empty.
Functions ¶
func CreateBlockFromHead ¶ added in v0.32.0
func CreateHeadWithSeries ¶
CreateHeadWithSeries returns head filled with given samples and same series returned in separate list for assertion purposes. Returned series list has "ext1"="1" prepended. Each series looks as follows: {foo=bar,i=000001aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd} <random value> where number indicate sample number from 0. Returned series are framed in the same way as remote read would frame them.
func ReadSeriesFromBlock ¶ added in v0.31.0
func TestServerSeries ¶
func TestServerSeries(t testutil.TB, store storepb.StoreServer, cases ...*SeriesCase)
TestServerSeries runs tests against given cases.
Types ¶
type HeadGenOptions ¶
type SeriesCase ¶
type SeriesCase struct { Name string Req *storepb.SeriesRequest // Exact expectations are checked only for tests. For benchmarks only length is assured. ExpectedSeries []*storepb.Series ExpectedWarnings []string ExpectedHints []hintspb.SeriesResponseHints HintsCompareFunc func(t testutil.TB, expected, actual hintspb.SeriesResponseHints) }
SeriesCase represents single test/benchmark case for testing storepb series.
type SeriesServer ¶
type SeriesServer struct { // This field just exist to pseudo-implement the unused methods of the interface. storepb.Store_SeriesServer SeriesSet []*storepb.Series Warnings []string HintsSet []*types.Any Size int64 // contains filtered or unexported fields }
SeriesServer is test gRPC storeAPI series server.
func NewSeriesServer ¶
func NewSeriesServer(ctx context.Context) *SeriesServer
func (*SeriesServer) Context ¶
func (s *SeriesServer) Context() context.Context
func (*SeriesServer) Send ¶
func (s *SeriesServer) Send(r *storepb.SeriesResponse) error
type StoreSeriesClient ¶ added in v0.32.0
type StoreSeriesClient struct { // This field just exist to pseudo-implement the unused methods of the interface. storepb.Store_SeriesClient Ctx context.Context RespSet []*storepb.SeriesResponse RespDur time.Duration SlowSeriesIndex int InjectedError error InjectedErrorIndex int // contains filtered or unexported fields }
StoreSeriesClient is test gRPC storeAPI series client.
func (*StoreSeriesClient) Context ¶ added in v0.32.0
func (c *StoreSeriesClient) Context() context.Context
func (*StoreSeriesClient) Recv ¶ added in v0.32.0
func (c *StoreSeriesClient) Recv() (*storepb.SeriesResponse, error)
type TestClient ¶ added in v0.31.0
type TestClient struct { storepb.StoreClient Name string ExtLset []labels.Labels MinTime, MaxTime int64 Shardable bool WithoutReplicaLabelsEnabled bool IsLocalStore bool StoreTSDBInfos []infopb.TSDBInfo }
func (TestClient) Addr ¶ added in v0.31.0
func (c TestClient) Addr() (string, bool)
func (TestClient) LabelSets ¶ added in v0.31.0
func (c TestClient) LabelSets() []labels.Labels
func (TestClient) String ¶ added in v0.31.0
func (c TestClient) String() string
func (TestClient) SupportsSharding ¶ added in v0.31.0
func (c TestClient) SupportsSharding() bool
func (TestClient) SupportsWithoutReplicaLabels ¶ added in v0.31.0
func (c TestClient) SupportsWithoutReplicaLabels() bool
func (TestClient) TSDBInfos ¶ added in v0.32.0
func (c TestClient) TSDBInfos() []infopb.TSDBInfo
func (TestClient) TimeRange ¶ added in v0.31.0
func (c TestClient) TimeRange() (mint, maxt int64)
Click to show internal directories.
Click to hide internal directories.