| 136 | } |
| 137 | |
| 138 | func TestGRPC_GetOutboundsStats(t *testing.T) { |
| 139 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |
| 140 | defer cancel() |
| 141 | |
| 142 | stats, err := sharedTestCtx.client.GetStats(ctx, &common.StatRequest{Reset_: true, Type: common.StatType_Outbounds}) |
| 143 | if err != nil { |
| 144 | t.Fatalf("Failed to get outbounds stats: %v", err) |
| 145 | } |
| 146 | |
| 147 | for _, stat := range stats.GetStats() { |
| 148 | log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link) |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | func TestGRPC_GetInboundsStats(t *testing.T) { |
| 153 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |