Explorar el Código

Use correct type for prom queue.

Matt Bolt hace 4 años
padre
commit
8535f91529
Se han modificado 1 ficheros con 6 adiciones y 8 borrados
  1. 6 8
      pkg/prom/diagnostics.go

+ 6 - 8
pkg/prom/diagnostics.go

@@ -37,14 +37,12 @@ func GetPrometheusQueueState(client prometheus.Client) (*PrometheusQueueState, e
 	outbound := rlpc.TotalOutboundRequests()
 
 	requests := []*QueuedPromRequest{}
-	rlpc.queue.Each(func(_ int, entry interface{}) {
-		if req, ok := entry.(*workRequest); ok {
-			requests = append(requests, &QueuedPromRequest{
-				Context:   req.contextName,
-				Query:     req.query,
-				QueueTime: time.Since(req.start).Milliseconds(),
-			})
-		}
+	rlpc.queue.Each(func(_ int, req *workRequest) {
+		requests = append(requests, &QueuedPromRequest{
+			Context:   req.contextName,
+			Query:     req.query,
+			QueueTime: time.Since(req.start).Milliseconds(),
+		})
 	})
 
 	return &PrometheusQueueState{