Documentation ¶
Index ¶
- Constants
- 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 TestClient
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 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 }
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 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 }
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) TimeRange ¶ added in v0.31.0
func (c TestClient) TimeRange() (mint, maxt int64)
Click to show internal directories.
Click to hide internal directories.