From ccdda2565ea1ede5ea6921b8d4db22cb59282d14 Mon Sep 17 00:00:00 2001 From: Christian Haudum Date: Thu, 4 Apr 2024 21:18:52 +0200 Subject: [PATCH] Update pkg/bloomgateway/client.go Co-authored-by: Owen Diehl --- pkg/bloomgateway/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/bloomgateway/client.go b/pkg/bloomgateway/client.go index 60d28205cdba0..2f437cd7e28dd 100644 --- a/pkg/bloomgateway/client.go +++ b/pkg/bloomgateway/client.go @@ -231,7 +231,7 @@ func (c *GatewayClient) FilterChunks(ctx context.Context, tenant string, from, t // overlap on instances to the left and right of the range. firstFp, lastFp := groups[0].Fingerprint, groups[len(groups)-1].Fingerprint pctKeyspace := float64(lastFp-firstFp) / float64(math.MaxUint64) - pctInstances := float64(len(servers)) / float64(len(c.pool.Addrs())) + pctInstances := float64(len(servers)) / float64(max(1,len(c.pool.Addrs()))) cacheLocalityScore := pctKeyspace / pctInstances c.metrics.cacheLocalityScore.Observe(cacheLocalityScore) }