| 343 | } |
| 344 | |
| 345 | func TestGRPC_GetSpecificOutboundStats(t *testing.T) { |
| 346 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |
| 347 | defer cancel() |
| 348 | |
| 349 | stats, err := sharedTestCtx.client.GetStats(ctx, &common.StatRequest{Name: "direct", Reset_: true, Type: common.StatType_Outbound}) |
| 350 | if err != nil { |
| 351 | t.Fatalf("Failed to get outbound stats: %v", err) |
| 352 | } |
| 353 | for _, stat := range stats.GetStats() { |
| 354 | log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link) |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | func TestGRPC_GetSpecificInboundStats(t *testing.T) { |
| 359 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |