MCPcopy Create free account
hub / github.com/github/gh-aw / TestGetSortedServerNames

Function TestGetSortedServerNames

pkg/cli/gateway_logs_test.go:405–430  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

403}
404
405func TestGetSortedServerNames(t *testing.T) {
406 metrics := &GatewayMetrics{
407 Servers: map[string]*GatewayServerMetrics{
408 "github": {
409 ServerName: "github",
410 RequestCount: 10,
411 },
412 "playwright": {
413 ServerName: "playwright",
414 RequestCount: 5,
415 },
416 "tavily": {
417 ServerName: "tavily",
418 RequestCount: 15,
419 },
420 },
421 }
422
423 names := getSortedServerNames(metrics)
424 require.Len(t, names, 3)
425
426 // Should be sorted by request count (descending)
427 assert.Equal(t, "tavily", names[0])
428 assert.Equal(t, "github", names[1])
429 assert.Equal(t, "playwright", names[2])
430}
431
432func TestGatewayLogsWithMethodField(t *testing.T) {
433 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 1

getSortedServerNamesFunction · 0.85

Tested by

no test coverage detected