| 150 | } |
| 151 | |
| 152 | func TestGRPC_GetInboundsStats(t *testing.T) { |
| 153 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |
| 154 | defer cancel() |
| 155 | |
| 156 | stats, err := sharedTestCtx.client.GetStats(ctx, &common.StatRequest{Reset_: true, Type: common.StatType_Inbounds}) |
| 157 | if err != nil { |
| 158 | t.Fatalf("Failed to get inbounds stats: %v", err) |
| 159 | } |
| 160 | |
| 161 | for _, stat := range stats.GetStats() { |
| 162 | log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link) |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | func TestGRPC_GetUsersStats(t *testing.T) { |
| 167 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |