-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[OPIK-2679] [BE/FE] Add additional aggregation methods in headers for experiment items #4366
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
base: main
Are you sure you want to change the base?
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 adds percentile aggregation methods (p50, p90, p99) for numerical metrics in experiment items, extending the existing pattern from duration to cost, feedback scores, and total tokens.
Key changes:
- Backend adds percentile calculations in ClickHouse queries for cost, feedback scores, and tokens
- Frontend enhances the header statistics component to display both averages and percentiles in a unified dropdown
- Test coverage updated to verify percentile calculations across all scenarios
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| HeaderWrapper.tsx | Filters statistics to separate AVG and PERCENTAGE types, passing both to HeaderStatistic |
| HeaderStatistic.tsx | Refactored to support unified dropdown with avg/sum and percentile options based on available data |
| ExperimentItemsTab.tsx | Added statisticKey properties to cost and total tokens columns |
| DatasetsResourceTest.java | Added comprehensive test data and assertions for percentile calculations |
| StatsMapper.java | Added helper methods to process and format percentile data from ClickHouse |
| DatasetItemDAO.java | Extended ClickHouse query to compute percentiles for cost, feedback scores, and tokens |
apps/opik-frontend/src/components/shared/DataTableHeaders/HeaderWrapper.tsx
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/domain/stats/StatsMapper.java
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/domain/DatasetItemDAO.java
Show resolved
Hide resolved
|
✅ Test environment is now available! Access Information
The deployment has completed successfully and the version has been verified. |
Backend Tests Results 356 files 356 suites 52m 42s ⏱️ Results for commit aad4ed5. |
Details
This PR adds percentile aggregation methods (p50, p90, p99) for numerical metrics in experiment items table headers, extending the existing pattern used for duration to cost, feedback scores, and total tokens.
Backend Changes
Frontend Changes
Testing
Change checklist
Issues
Testing
Backend Tests
Manual Testing
Documentation
N/A - This is an internal UI/API enhancement that follows existing patterns. No external documentation updates required.