MCPcopy Create free account
hub / github.com/PasarGuard/node / TestREST_GetUsersStats

Function TestREST_GetUsersStats

controller/rest/rest_test.go:236–246  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

234}
235
236func TestREST_GetUsersStats(t *testing.T) {
237 var stats common.StatResponse
238 if err := sharedTestCtx.createAuthenticatedRequest("GET", "/stats", &common.StatRequest{Reset_: true, Type: common.StatType_UsersStat}, &stats); err != nil {
239 t.Fatalf("Failed to get users stats: %v", err)
240 }
241
242 for _, stat := range stats.GetStats() {
243 log.Printf("Users Stat - Name: %s, Traffic: %d, Type: %s, Link: %s",
244 stat.GetName(), stat.GetValue(), stat.GetType(), stat.GetLink())
245 }
246}
247
248func TestREST_GetBackendStats(t *testing.T) {
249 var backendStats common.BackendStatsResponse

Callers

nothing calls this directly

Calls 5

GetStatsMethod · 0.95
GetNameMethod · 0.45
GetValueMethod · 0.45
GetTypeMethod · 0.45
GetLinkMethod · 0.45

Tested by

no test coverage detected