getSortedServerNames returns server names sorted by request count
(metrics *GatewayMetrics)
| 187 | |
| 188 | // getSortedServerNames returns server names sorted by request count |
| 189 | func getSortedServerNames(metrics *GatewayMetrics) []string { |
| 190 | names := sliceutil.MapKeys(metrics.Servers) |
| 191 | slices.SortFunc(names, func(a, b string) int { |
| 192 | if metrics.Servers[a].RequestCount > metrics.Servers[b].RequestCount { |
| 193 | return -1 |
| 194 | } |
| 195 | if metrics.Servers[a].RequestCount < metrics.Servers[b].RequestCount { |
| 196 | return 1 |
| 197 | } |
| 198 | return 0 |
| 199 | }) |
| 200 | return names |
| 201 | } |
| 202 | |
| 203 | // displayAggregatedGatewayMetrics aggregates and displays gateway metrics across all processed runs |
| 204 | func displayAggregatedGatewayMetrics(processedRuns []ProcessedRun, outputDir string, verbose bool) { |