MCPcopy Index your code
hub / github.com/PasarGuard/node / TestGRPC_GetSpecificUserStats

Function TestGRPC_GetSpecificUserStats

controller/rpc/rpc_test.go:332–343  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

330}
331
332func TestGRPC_GetSpecificUserStats(t *testing.T) {
333 ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second)
334 defer cancel()
335
336 stats, err := sharedTestCtx.client.GetStats(ctx, &common.StatRequest{Name: "test_user2@example.com", Reset_: true, Type: common.StatType_UsersStat})
337 if err != nil {
338 t.Fatalf("Failed to get user stats: %v", err)
339 }
340 for _, stat := range stats.GetStats() {
341 log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)
342 }
343}
344
345func TestGRPC_GetSpecificOutboundStats(t *testing.T) {
346 ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second)

Callers

nothing calls this directly

Calls 1

GetStatsMethod · 0.65

Tested by

no test coverage detected