MCPcopy Create free account
hub / github.com/cortexproject/cortex / AddDataBytes

Method AddDataBytes

pkg/util/limiter/query_limiter.go:111–119  ·  view source on GitHub ↗

AddDataBytes adds the queried data bytes and returns an error if the limit is reached.

(dataSizeInBytes int)

Source from the content-addressed store, hash-verified

109
110// AddDataBytes adds the queried data bytes and returns an error if the limit is reached.
111func (ql *QueryLimiter) AddDataBytes(dataSizeInBytes int) error {
112 if ql.maxDataBytesPerQuery == 0 {
113 return nil
114 }
115 if ql.dataBytesCount.Add(int64(dataSizeInBytes)) > int64(ql.maxDataBytesPerQuery) {
116 return fmt.Errorf(ErrMaxDataBytesHit, ql.maxDataBytesPerQuery)
117 }
118 return nil
119}
120
121func (ql *QueryLimiter) AddChunks(count int) error {
122 if ql.maxChunksPerQuery == 0 {

Callers 12

queryIngesterStreamMethod · 0.80
LabelNamesStreamMethod · 0.80
LabelNamesMethod · 0.80
NewParquetQueryableFunction · 0.80
fetchSeriesFromStoresMethod · 0.80

Calls 1

AddMethod · 0.45

Tested by 1