testutil

package
v3.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeStream

func NewFakeStream(from int, quantity int) logproto.Stream

mockStream return a stream with quantity entries, where entries timestamp and line string are constructed as sequential numbers starting at from

func NewFakeStreamIterator

func NewFakeStreamIterator(from int, quantity int) iter.EntryIterator

mockStreamIterator returns an iterator with 1 stream and quantity entries, where entries timestamp and line string are constructed as sequential numbers starting at from

func NewFakeStreamWithLabels

func NewFakeStreamWithLabels(from int, quantity int, labels string) logproto.Stream

Types

type MockLimits

type MockLimits struct {
	MaxQueryLookbackVal           time.Duration
	MaxQueryLengthVal             time.Duration
	MaxQueryTimeoutVal            time.Duration
	MaxQueryRangeVal              time.Duration
	MaxQuerySeriesVal             int
	MaxConcurrentTailRequestsVal  int
	MaxEntriesLimitPerQueryVal    int
	MaxStreamsMatchersPerQueryVal int
	EnableMultiVariantQueriesVal  bool
	MetricAggregationEnabledVal   bool
	PatternPersistenceEnabledVal  bool
	PatternRateThresholdVal       float64
	PersistenceGranularityVal     time.Duration
}

MockLimits is a mock implementation of limits.Limits interface that can be used in tests

func (*MockLimits) BlockedQueries

func (m *MockLimits) BlockedQueries(_ context.Context, _ string) []*validation.BlockedQuery

func (*MockLimits) EnableMultiVariantQueries

func (m *MockLimits) EnableMultiVariantQueries(_ string) bool

func (*MockLimits) MaxConcurrentTailRequests

func (m *MockLimits) MaxConcurrentTailRequests(_ context.Context, _ string) int

func (*MockLimits) MaxEntriesLimitPerQuery

func (m *MockLimits) MaxEntriesLimitPerQuery(_ context.Context, _ string) int

func (*MockLimits) MaxQueryLength

func (m *MockLimits) MaxQueryLength(_ context.Context, _ string) time.Duration

func (*MockLimits) MaxQueryLookback

func (m *MockLimits) MaxQueryLookback(_ context.Context, _ string) time.Duration

func (*MockLimits) MaxQueryRange

func (m *MockLimits) MaxQueryRange(_ context.Context, _ string) time.Duration

func (*MockLimits) MaxQuerySeries

func (m *MockLimits) MaxQuerySeries(_ context.Context, _ string) int

func (*MockLimits) MaxStreamsMatchersPerQuery

func (m *MockLimits) MaxStreamsMatchersPerQuery(_ context.Context, _ string) int

func (*MockLimits) MetricAggregationEnabled added in v3.6.0

func (m *MockLimits) MetricAggregationEnabled(_ string) bool

func (*MockLimits) PatternIngesterTokenizableJSONFields added in v3.6.0

func (m *MockLimits) PatternIngesterTokenizableJSONFields(_ string) []string

PatternIngesterTokenizableJSONFields implements pattern.drain.Limits interface

func (*MockLimits) PatternPersistenceEnabled added in v3.6.0

func (m *MockLimits) PatternPersistenceEnabled(_ string) bool

PatternPersistenceEnabled implements pattern.Limits interface

func (*MockLimits) PatternRateThreshold added in v3.6.0

func (m *MockLimits) PatternRateThreshold(_ string) float64

PatternRateThreshold implements pattern.Limits interface

func (*MockLimits) PersistenceGranularity added in v3.6.0

func (m *MockLimits) PersistenceGranularity(_ string) time.Duration

PersistenceGranularity implements pattern.Limits interface

func (*MockLimits) QueryTimeout

func (m *MockLimits) QueryTimeout(_ context.Context, _ string) time.Duration

Jump to

Keyboard shortcuts

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