Skip to content

feat(statistics): add user count activity chart#452

Merged
x0sina merged 9 commits into
devfrom
user-count-chart
May 8, 2026
Merged

feat(statistics): add user count activity chart#452
x0sina merged 9 commits into
devfrom
user-count-chart

Conversation

@x0sina
Copy link
Copy Markdown
Collaborator

@x0sina x0sina commented May 8, 2026

Summary

  • Added backend user count metric stats for online, expired, and limited users
  • Added /api/users/counts/{metric} endpoint with admin, date range, period, node, and group-by-node support
  • Added dashboard user count chart with metric selector, time/custom range filters, admin filtering, node grouping, and detail modal
  • Improved chart empty states, stacking behavior, and related usage modal layout
  • Added translations for the new statistics labels

Notes

  • Node-scoped and group-by-node counts are limited to the online metric
  • Added an accuracy note because reset usage or user status changes can affect historical chart data

Tests

  • Added/updated API tests for user/node count metrics and timezone behavior

x0sina added 9 commits May 8, 2026 13:34
…itions

- Introduced `get_user_count_stats` function to aggregate user activity and status counts from `node_user_usages`.
- Added `UserCountStat` and `UserCountStatsList` models to represent user count statistics.
- Updated relevant CRUD operations, routers, and tests to support the new user count statistics functionality.
- Enhanced API endpoints for retrieving user counts with filtering options based on time periods and node grouping.
…d models

- Added `get_user_count_metric_stats` function to retrieve distinct user count metrics from `node_user_usages`.
- Introduced `UserCountMetric`, `UserCountMetricStat`, and `UserCountMetricStatsList` models for handling user count metrics.
- Updated CRUD operations, routers, and tests to support the new user count metrics functionality.
- Enhanced API endpoints for retrieving user count metrics with filtering options based on time periods and node grouping.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7bfb7d03-91f9-4229-8da8-2235eb1510c9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch user-count-chart

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@x0sina x0sina merged commit d471636 into dev May 8, 2026
16 checks passed
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