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

Method CheckReady

pkg/frontend/v1/frontend.go:381–391  ·  view source on GitHub ↗

CheckReady determines if the query frontend is ready. Function parameters/return chosen to match the same method in the ingester

(_ context.Context)

Source from the content-addressed store, hash-verified

379// CheckReady determines if the query frontend is ready. Function parameters/return
380// chosen to match the same method in the ingester
381func (f *Frontend) CheckReady(_ context.Context) error {
382 // if we have more than one querier connected we will consider ourselves ready
383 connectedClients := f.requestQueue.GetConnectedQuerierWorkersMetric()
384 if connectedClients > 0 {
385 return nil
386 }
387
388 msg := fmt.Sprintf("not ready: number of queriers connected to query-frontend is %d", int64(connectedClients))
389 level.Info(f.log).Log("msg", msg)
390 return errors.New(msg)
391}

Callers 1

TestFrontendCheckReadyFunction · 0.95

Calls 2

LogMethod · 0.45

Tested by 1

TestFrontendCheckReadyFunction · 0.76