| 356 | } |
| 357 | |
| 358 | func TestGRPC_GetSpecificInboundStats(t *testing.T) { |
| 359 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |
| 360 | defer cancel() |
| 361 | |
| 362 | stats, err := sharedTestCtx.client.GetStats(ctx, &common.StatRequest{Name: "Shadowsocks TCP", Reset_: true, Type: common.StatType_Inbounds}) |
| 363 | if err != nil { |
| 364 | t.Fatalf("Failed to get inbound stats: %v", err) |
| 365 | } |
| 366 | for _, stat := range stats.GetStats() { |
| 367 | log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link) |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | func TestGRPC_GetLogsStream(t *testing.T) { |
| 372 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |