Skip to content

Commit 841d578

Browse files
committed
fix test
Signed-off-by: Justin Jung <[email protected]>
1 parent a2ffcdd commit 841d578

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pkg/ingester/ingester.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,6 @@ func New(cfg Config, limits *validation.Overrides, registerer prometheus.Registe
721721
ingestionRate: util_math.NewEWMARate(0.2, instanceIngestionRateTickInterval),
722722
expandedPostingsCacheFactory: cortex_tsdb.NewExpandedPostingsCacheFactory(cfg.BlocksStorageConfig.TSDB.PostingsCache),
723723
matchersCache: storecache.NoopMatchersCache,
724-
resourceMonitor: resourceMonitor,
725724
}
726725

727726
if cfg.MatchersCacheMaxItems > 0 {
@@ -2156,7 +2155,7 @@ func (i *Ingester) trackInflightQueryRequest() (func(), error) {
21562155

21572156
i.maxInflightQueryRequests.Track(i.inflightQueryRequests.Inc())
21582157

2159-
if i.resourceMonitor != nil {
2158+
if _, ok := i.resourceMonitor.(*resource.Monitor); ok {
21602159
if resourceName, threshold, utilization, err := i.resourceMonitor.CheckResourceUtilization(); err != nil {
21612160
level.Warn(i.logger).Log("msg", "resource threshold breached", "resource", resourceName, "threshold", threshold, "utilization", utilization)
21622161
return nil, errors.Wrapf(err, "failed to query")

pkg/storegateway/gateway.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func (g *StoreGateway) LabelValues(ctx context.Context, req *storepb.LabelValues
408408
}
409409

410410
func (g *StoreGateway) checkResourceUtilization() error {
411-
if g.resourceMonitor == nil {
411+
if _, ok := g.resourceMonitor.(*resource.Monitor); !ok {
412412
return nil
413413
}
414414

0 commit comments

Comments
 (0)