Skip to content

feat: implement group stats handler with real data#1285

Open
thuanpham582002 wants to merge 1 commit intoWei-Shaw:mainfrom
thuanpham582002:feat/implement-group-stats
Open

feat: implement group stats handler with real data#1285
thuanpham582002 wants to merge 1 commit intoWei-Shaw:mainfrom
thuanpham582002:feat/implement-group-stats

Conversation

@thuanpham582002
Copy link

Summary

  • Replace mock/hardcoded zeros in GetStats handler with actual statistics queried from existing services
  • Fetch total API keys count via GetGroupAPIKeys
  • Fetch total accounts count via ListAccounts filtered by group ID
  • Fetch total requests and cost via GetGroupStatsWithFilters from the dashboard service
  • Remove the unused groupID suppression (_ = groupID)

Test plan

  • go build and go vet pass with no errors
  • Verify /api/v1/admin/groups/:id/stats returns real data for a group with API keys and usage
  • Verify the endpoint returns zeros for a group with no activity

Replace mock data in GetStats handler with actual statistics:
- Total API keys count via GetGroupAPIKeys
- Total accounts count via ListAccounts filtered by group
- Total requests and cost via GetGroupStatsWithFilters from dashboard service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant