| 164 | } |
| 165 | |
| 166 | func TestGRPC_GetUsersStats(t *testing.T) { |
| 167 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |
| 168 | defer cancel() |
| 169 | |
| 170 | stats, err := sharedTestCtx.client.GetStats(ctx, &common.StatRequest{Reset_: true, Type: common.StatType_UsersStat}) |
| 171 | if err != nil { |
| 172 | t.Fatalf("Failed to get users stats: %v", err) |
| 173 | } |
| 174 | |
| 175 | for _, stat := range stats.GetStats() { |
| 176 | log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | func TestGRPC_GetUserOnlineStats_NotFound(t *testing.T) { |
| 181 | ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second) |