github.com/grafana/pyroscope@v1.18.0/pkg/validation/testutil.go (about)

     1  package validation
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  type MockLimits struct {
     8  	QuerySplitDurationValue         time.Duration
     9  	MaxQueryParallelismValue        int
    10  	MaxQueryLengthValue             time.Duration
    11  	MaxQueryLookbackValue           time.Duration
    12  	QueryAnalysisEnabledValue       bool
    13  	QuerySanitizeOnMergeValue       bool
    14  	QueryAnalysisSeriesEnabledValue bool
    15  	MaxLabelNameLengthValue         int
    16  	MaxLabelValueLengthValue        int
    17  	MaxLabelNamesPerSeriesValue     int
    18  
    19  	MaxFlameGraphNodesDefaultValue              int
    20  	MaxFlameGraphNodesMaxValue                  int
    21  	MaxFlameGraphNodesOnSelectMergeProfileValue bool
    22  
    23  	DistributorAggregationWindowValue time.Duration
    24  	DistributorAggregationPeriodValue time.Duration
    25  
    26  	RejectOlderThanValue time.Duration
    27  	RejectNewerThanValue time.Duration
    28  
    29  	MaxProfileSizeBytesValue              int
    30  	MaxProfileStacktraceSamplesValue      int
    31  	MaxProfileStacktraceDepthValue        int
    32  	MaxProfileStacktraceSampleLabelsValue int
    33  	MaxProfileSymbolValueLengthValue      int
    34  
    35  	MaxQueriersPerTenantValue int
    36  
    37  	SymbolizerEnabledValue bool
    38  
    39  	IngestionBodyLimitBytesValue int64
    40  }
    41  
    42  func (m MockLimits) QuerySplitDuration(string) time.Duration        { return m.QuerySplitDurationValue }
    43  func (m MockLimits) MaxQueryParallelism(string) int                 { return m.MaxQueryParallelismValue }
    44  func (m MockLimits) MaxQueryLength(tenantID string) time.Duration   { return m.MaxQueryLengthValue }
    45  func (m MockLimits) MaxQueryLookback(tenantID string) time.Duration { return m.MaxQueryLookbackValue }
    46  func (m MockLimits) QueryAnalysisEnabled(tenantID string) bool      { return m.QueryAnalysisEnabledValue }
    47  func (m MockLimits) QueryAnalysisSeriesEnabled(tenantID string) bool {
    48  	return m.QueryAnalysisSeriesEnabledValue
    49  }
    50  func (m MockLimits) QuerySanitizeOnMerge(tenantID string) bool {
    51  	return m.QuerySanitizeOnMergeValue
    52  }
    53  func (m MockLimits) MaxFlameGraphNodesDefault(string) int { return m.MaxFlameGraphNodesDefaultValue }
    54  func (m MockLimits) MaxFlameGraphNodesMax(string) int     { return m.MaxFlameGraphNodesMaxValue }
    55  func (m MockLimits) MaxFlameGraphNodesOnSelectMergeProfile(string) bool {
    56  	return m.MaxFlameGraphNodesOnSelectMergeProfileValue
    57  }
    58  
    59  func (m MockLimits) MaxLabelNameLength(userID string) int     { return m.MaxLabelNameLengthValue }
    60  func (m MockLimits) MaxLabelValueLength(userID string) int    { return m.MaxLabelValueLengthValue }
    61  func (m MockLimits) MaxLabelNamesPerSeries(userID string) int { return m.MaxLabelNamesPerSeriesValue }
    62  func (m MockLimits) MaxProfileSizeBytes(userID string) int    { return m.MaxProfileSizeBytesValue }
    63  func (m MockLimits) MaxProfileStacktraceSamples(userID string) int {
    64  	return m.MaxProfileStacktraceSamplesValue
    65  }
    66  
    67  func (m MockLimits) DistributorAggregationWindow(userID string) time.Duration {
    68  	return m.DistributorAggregationWindowValue
    69  }
    70  func (m MockLimits) DistributorAggregationPeriod(userID string) time.Duration {
    71  	return m.DistributorAggregationPeriodValue
    72  }
    73  
    74  func (m MockLimits) MaxProfileStacktraceDepth(userID string) int {
    75  	return m.MaxProfileStacktraceDepthValue
    76  }
    77  
    78  func (m MockLimits) MaxProfileStacktraceSampleLabels(userID string) int {
    79  	return m.MaxProfileStacktraceSampleLabelsValue
    80  }
    81  
    82  func (m MockLimits) MaxProfileSymbolValueLength(userID string) int {
    83  	return m.MaxProfileSymbolValueLengthValue
    84  }
    85  
    86  func (m MockLimits) MaxQueriersPerTenant(_ string) int {
    87  	return m.MaxQueriersPerTenantValue
    88  }
    89  
    90  func (m MockLimits) RejectOlderThan(userID string) time.Duration {
    91  	return m.RejectOlderThanValue
    92  }
    93  
    94  func (m MockLimits) RejectNewerThan(userID string) time.Duration {
    95  	return m.RejectNewerThanValue
    96  }
    97  
    98  func (m MockLimits) SymbolizerEnabled(s string) bool { return m.SymbolizerEnabledValue }
    99  
   100  func (m MockLimits) IngestionBodyLimitBytes(tenantID string) int64 {
   101  	return m.IngestionBodyLimitBytesValue
   102  }