| 330 | } |
| 331 | |
| 332 | func 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 | |
| 345 | func TestGRPC_GetSpecificOutboundStats(t *testing.T) { |
| 346 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |