@@ -62,6 +62,8 @@ type NGFResourceCounts struct {
62
62
GatewayClassCount int64
63
63
// HTTPRouteCount is the number of relevant HTTPRoutes.
64
64
HTTPRouteCount int64
65
+ // TLSRouteCount is the number of relevant TLSRoutes.
66
+ TLSRouteCount int64
65
67
// SecretCount is the number of relevant Secrets.
66
68
SecretCount int64
67
69
// ServiceCount is the number of relevant Services.
@@ -188,7 +190,11 @@ func collectGraphResourceCount(
188
190
ngfResourceCounts .GatewayCount ++
189
191
}
190
192
191
- ngfResourceCounts .HTTPRouteCount , ngfResourceCounts .GRPCRouteCount = computeRouteCount (g .Routes )
193
+ routeCounts := computeRouteCount (g .Routes , g .L4Routes )
194
+ ngfResourceCounts .HTTPRouteCount = routeCounts .HTTPRouteCount
195
+ ngfResourceCounts .GRPCRouteCount = routeCounts .GRPCRouteCount
196
+ ngfResourceCounts .TLSRouteCount = routeCounts .TLSRouteCount
197
+
192
198
ngfResourceCounts .SecretCount = int64 (len (g .ReferencedSecrets ))
193
199
ngfResourceCounts .ServiceCount = int64 (len (g .ReferencedServices ))
194
200
@@ -224,7 +230,19 @@ func collectGraphResourceCount(
224
230
return ngfResourceCounts , nil
225
231
}
226
232
227
- func computeRouteCount (routes map [graph.RouteKey ]* graph.L7Route ) (httpRouteCount , grpcRouteCount int64 ) {
233
+ type RouteCounts struct {
234
+ HTTPRouteCount int64
235
+ GRPCRouteCount int64
236
+ TLSRouteCount int64
237
+ }
238
+
239
+ func computeRouteCount (
240
+ routes map [graph.RouteKey ]* graph.L7Route ,
241
+ l4routes map [graph.L4RouteKey ]* graph.L4Route ,
242
+ ) RouteCounts {
243
+ httpRouteCount := int64 (0 )
244
+ grpcRouteCount := int64 (0 )
245
+
228
246
for _ , r := range routes {
229
247
if r .RouteType == graph .RouteTypeHTTP {
230
248
httpRouteCount = httpRouteCount + 1
@@ -233,7 +251,12 @@ func computeRouteCount(routes map[graph.RouteKey]*graph.L7Route) (httpRouteCount
233
251
grpcRouteCount = grpcRouteCount + 1
234
252
}
235
253
}
236
- return httpRouteCount , grpcRouteCount
254
+
255
+ return RouteCounts {
256
+ HTTPRouteCount : httpRouteCount ,
257
+ GRPCRouteCount : grpcRouteCount ,
258
+ TLSRouteCount : int64 (len (l4routes )),
259
+ }
237
260
}
238
261
239
262
func getPodReplicaSet (
0 commit comments