Title: fix: Keep the baseline out of monitoring windows and align its overlay by Nitant28 · Pull Request #7057 · feast-dev/feast · GitHub
Open Graph Title: fix: Keep the baseline out of monitoring windows and align its overlay by Nitant28 · Pull Request #7057 · feast-dev/feast
X Title: fix: Keep the baseline out of monitoring windows and align its overlay by Nitant28 · Pull Request #7057 · feast-dev/feast
Description: What this PR does / why we need it: Fixes the monitoring UI problems described in #7054 (with screenshots). There is one commit for each cause. 1. fix: Keep the baseline out of the Monitoring pages' window views /monitoring/metrics/features returns the baseline row alongside the windows, dated by the day it was computed. The pages treated it as a window. A new pages/monitoring/metricSelection.ts holds the shared selection logic: latestWindowMetric(): the Monitoring tab now shows the newest window, not the baseline compared with itself. It shows the baseline on its own ("Baseline Distribution", no overlay) only when no window exists yet. windowGranularities(): the detail page's View options no longer include the raw "baseline" row (it keeps its "Baseline (all data)" option), and are ordered shortest window first, so the page opens on Daily. seriesForGranularity(): the detail page's Time-Series Analysis plots one granularity (the viewed one, or the shortest when the baseline is viewed) instead of every row on one line. 2. fix: Draw the Monitoring tab's baseline overlay on the window's bins The overlay drew baseline bin i behind window bin i, although every stored histogram has its own edges, and scaled both by raw counts, although the baseline has many more rows. A ×100 unit change drew the same bars as a clean day. alignBaselineToBins() (new, components/histogramAlignment.ts) moves each baseline bin's count onto the window's bins by overlap and scales it to the window's row count. Values are treated as uniform within a bin; a zero-width bin (the SQL backends' constant-column form) as a point. A constant window takes the whole baseline bin that contains its value, so a 0/1 flag compares against the baseline's share of zeros. The legend states the share of the baseline outside the window's range. A non-numeric baseline (left from before a feature changed type) is no longer overlaid. On master it throws TypeError: undefined is not iterable. Design notes Scaling instead of shares: scaling to the window's row count keeps the y-axis and tooltips in this window's rows. Why UI-only: /monitoring/metrics/features and the baseline's metric_date are unchanged. Changing either would change the REST response or the stored data (metric_date is part of FEATURE_METRICS_PK), which seems out of scope for a UI fix. Untouched: the categorical chart and the time-series component. If you'd prefer, the two commits split cleanly into two PRs (they share no files). Relation to #7056. I reported #7054 with this fix ready, and #7056 has since been opened for it too. Both take the same overall approach. In case it helps you choose or combine them, the differences I see are: Constant columns: SQL backends store a constant column as one zero-width bin. Here that bin is treated as a point, so the overlay still works when either side is constant. #7056 skips zero-width bins. Partial overlap: here the baseline is scaled by its full row count, and the legend reports the share outside the window's range (39% in the ×100 case in #7054). #7056 renormalizes the overlapping part to 100%, so that share isn't visible. Detail page default: here window lengths are ordered shortest first, so the page opens on Daily. #7056 keeps the alphabetical order, so it opens on Biweekly. Tests: 19 here, including 3 render tests that fail on master. #7056 has 9 unit tests. I'm happy to go with whichever you prefer, or to fold anything useful from #7056 into this one. Which issue(s) this PR fixes: Fixes #7054 Checks I've made sure the tests are passing. My commits are signed off (git commit -s) My PR title follows conventional commits format Testing Strategy Unit tests Integration tests Manual tests Testing is not required for this change 19 new jest tests: metricSelection.test.ts (6): uses the rows /monitoring/metrics/features returns after a feast monitor run on the demo. Covers the latest window, baseline only, empty windows, granularity order, and single-granularity series. histogramAlignment.test.ts (10): edges, scaling, a shift past the baseline's range, zero-width bins on either side, a constant 0/1 window, edge values, an empty baseline, a missing last edge. HistogramChart.test.tsx (3, render): all three fail on master. A baseline with 100× the rows draws window bars 1.6 px tall against 160 px baseline bars. A window above the baseline's range still gets full-height baseline bars. A categorical baseline throws. Local results (Windows, Node 20; .nvmrc pins 22, which CI uses): The new tests pass on this branch, rebased on master at e304a84. prettier --check, eslint, tsc and the build:lib type check pass, and so does the production build with CI=true. Full suite: 38 of 39 pass. The one failure is in FeastUISansProviders.test.tsx, which fails 1–3 of its tests per run on this machine: timeouts, and getByRole heading lookups right after navigation. It fails the same way on unmodified master ("Feature Views" and "Data Sources" headings not found). Manual: the steps in #7054 on the feast init demo, served by feast ui with this build. The screenshots below cover the tab after a fresh run, on a clean day and on a ×100 day, plus the detail page. Misc The overlay is approximate when values aren't uniform within a baseline bin. The stored histograms keep only bin counts, so some within-bin assumption is unavoidable. cc @jyejare
Open Graph Description: What this PR does / why we need it: Fixes the monitoring UI problems described in #7054 (with screenshots). There is one commit for each cause. 1. fix: Keep the baseline out of the Monitoring pages...
X Description: What this PR does / why we need it: Fixes the monitoring UI problems described in #7054 (with screenshots). There is one commit for each cause. 1. fix: Keep the baseline out of the Monitoring pages...
Opengraph URL: https://github.com/feast-dev/feast/pull/7057
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6b8acef3-145f-fc63-c58a-790457e0d9b3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B042:79CF9:32A4B1:434C13:6AFE98A8 |
| html-safe-nonce | 631a328195bc64af59b35e022b8eaf5ecb6c9637a0c101f992115815a10aa8db |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDQyOjc5Q0Y5OjMyQTRCMTo0MzRDMTM6NkFGRTk4QTgiLCJ2aXNpdG9yX2lkIjoiMzgxNjkwMzY0OTI0MjU1MjQ4OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cb9a76bfb707646a82d1e27b7a2b70eb3a1a1a02dbe52c9f27816745247cfd20 |
| hovercard-subject-tag | pull_request:4947805082 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/feast-dev/feast/pull/7057/files |
| twitter:image | https://avatars.githubusercontent.com/u/241639402?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/241639402?s=400&v=4 |
| og:image:alt | What this PR does / why we need it: Fixes the monitoring UI problems described in #7054 (with screenshots). There is one commit for each cause. 1. fix: Keep the baseline out of the Monitoring pages... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width