-
Notifications
You must be signed in to change notification settings - Fork 18
Add a stats v2 endpoint #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new /api/stats_v2 endpoint with improved field naming and structure for the Flavortown dashboard. The changes rename statistical fields from avg_* to mean_* for consistency and add serialization methods to statistics result classes.
Changes:
- Renamed
avg_hang_time_*fields tomean_hang_time_*throughout the codebase for consistency - Added
as_dict()methods toOverallStatsResultandDailyStatsResultfor API serialization - Created new
/api/stats_v2endpoint with better field names and comprehensive time-period statistics
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| nephthys/api/stats_v2.py | New endpoint implementation providing all-time, daily, and weekly statistics |
| nephthys/utils/stats.py | Renamed fields, added serialization methods, and simplified ticket filtering logic |
| nephthys/api/stats.py | Updated to use renamed mean_* fields |
| nephthys/utils/starlette.py | Registered the new /api/stats_v2 route |
| nephthys/views/home/components/leaderboards.py | Updated references to use renamed fields |
| docs/api.md | Added comprehensive API documentation for the new endpoint |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ckclub#152) * Silence type error (that was annoying me) * Add new metric: oldest_unanswered_ticket_age_minutes * Fix datetime subtraction exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
For Flavortown dashboard!
Created a new API endpoint in order to name the fields better and format it a bit nicer.