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
[graph-ng] add temporal DataFrame alignment/outerJoin & move null-asZero pass inside #29250
Conversation
…move null-asZero pass inside
not sure what's going on here. VSCode doesnt seem to have issues. maybe it's not upgrading uPlot to
|
how are you measuring? 10x is surprising to me. i'd expect something closer to 3x speedup, in line with raw Flot [1] unless there are some drastic perf cliffs when adding more series, or you guys have accidenrally introduced some slowdowns through flot customization. it's also worth noting that starting with 1.4.0, uPlot uses a deferred/async rendering strategy via a microTask queue. so a simple https://github.com/leeoniya/uPlot/blob/master/bench/uPlot.html#L135 i'd like to perf test this myself but i'll dig into the Flot panel a bit today and add a few console.time calls to see. maybe some of the improvement you're seeing is from other panel-related changes and not just the graph? |
you can use |
@torkelo sorry, i think we've been talking past each other. i thought you were comparing to Flot, not the previous alignment strategy. in retrospect it should have been obvious. i think the main speedup here probably comes from the fast-path exit for single dataframes (which are already naturally aligned): grafana/packages/grafana-ui/src/components/GraphNG/utils.ts Lines 86 to 91 in 3eca6e2
|
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.
Names look good now -- still something funky with enums and uPlot typescript, but let's fix that in a different issue
* master: (71 commits) Security: Fixes minor security issue with alert notification webhooks that allowed GET & DELETE requests grafana#29330 Chore: Bump storybook to v6 (grafana#28926) ReleaseNotes: Updates release notes link in package.json (master) (grafana#29329) Docs: Accurately reflecting available variables (grafana#29302) Heatmap: Fixes issue introduced by new eventbus (grafana#29322) Dashboard Schemas (grafana#28793) devenv: Add docker load test which authenticates with API key (grafana#28905) Login: Fixes redirect url encoding issues of # %23 being unencoded after login (grafana#29299) InfluxDB: update flux library and support boolean label values (grafana#29310) Explore/Logs: Update Parsed fields to Detected fields (grafana#28881) GraphNG: Init refactorings and fixes (grafana#29275) fixing a broken relref link (grafana#29312) Drone: Upgrade build pipeline tool (grafana#29308) decreasing frontend docs threshold. (grafana#29304) Docker: update docker root group docs and docker image (grafana#29222) WebhookNotifier: Convert tests away from goconvey (grafana#29291) Annotations: fixing so when changing annotations query links submenu will be updated. (grafana#28990) [graph-ng] add temporal DataFrame alignment/outerJoin & move null-asZero pass inside (grafana#29250) Dashboard: Fixes kiosk state after being redirected to login page and back (grafana#29273) make it possible to hide change password link in profile menu (grafana#29246) ...
What this PR does / why we need it:
uPlot requires data to be aligned along x.
this changeset adds an alignment pass over a
DataFrame[]
and emits a single temporally-aligned DataFrame, in addition to a closuredisGap
null-testing function which uPlot needs to discern whichnull
s represent actual gaps from the original DataFrames, and whichnull
s are alignment artifacts.the code is largely based on my alignment code used in example 3, here: https://leeoniya.github.io/uPlot/demos/path-gap-clip.html
additionally, the zero-fill pass is moved into the the alignment function, since it felt like it belonged there.
Special notes for your reviewer:
something that still needs to be addressed is the requirement for
isGap
on every initialized series to be updated just prior to any.setData()
call, since these must always be kept in sync. something like this should be sufficient: