Skip to content

Conversation

@nfebe
Copy link
Contributor

@nfebe nfebe commented Dec 22, 2025

Add deployment field to PathStats struct and update top_paths query to group by both deployment and path. This enables the UI to show which deployment each slow endpoint belongs to.

Add deployment field to PathStats struct and update top_paths query
to group by both deployment and path. This enables the UI to show
which deployment each slow endpoint belongs to.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
@nfebe nfebe force-pushed the feat/traffic-dashboard-redesign branch from 695a4f2 to 09241a2 Compare December 22, 2025 18:39
@sourceant
Copy link

sourceant bot commented Dec 22, 2025

Code Review Summary

The pull request successfully enhances the GetStats functionality by adding deployment context to the 'Top Paths' statistics and reordering them by average response time. This is a valuable improvement for providing more granular insights into application performance and usage patterns.

🚀 Key Improvements

  • The TopPaths now include deployment_name, enriching the data with crucial context.
  • The ordering of TopPaths has been changed to avg_time DESC, effectively highlighting potential performance bottlenecks.
  • The PathStats struct has been correctly updated to accommodate the new Deployment field.

💡 Minor Suggestions

  • Consider abstracting the repetitive query execution and row scanning logic within GetStats into a helper function to improve maintainability and reduce duplication.

🚨 Critical Issues

  • Inconsistent Error Handling in GetStats: Several db.conn.Query and rows.Scan calls within the GetStats function silently swallow errors, leading to incomplete statistics being returned without notification. This behavior should be corrected to ensure robustness and proper error propagation to the caller. An inline suggestion has been provided for the TopPaths section, and this pattern should be applied consistently throughout the GetStats function.

Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. No specific code suggestions were generated. See the overview comment for a summary.

Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. No specific code suggestions were generated. See the overview comment for a summary.

@nfebe nfebe merged commit 8c5eca9 into main Dec 22, 2025
5 checks passed
@nfebe nfebe deleted the feat/traffic-dashboard-redesign branch December 22, 2025 18:46
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.

2 participants