Skip to content
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

refactor: points rework (v1) #1663

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from
Draft

refactor: points rework (v1) #1663

wants to merge 40 commits into from

Conversation

ClementTsang
Copy link
Owner

@ClementTsang ClementTsang commented Jan 20, 2025

Description

A description of the change, what it does, and why it was made. If relevant (such as any change that modifies the UI), please provide screenshots of the changes:

Rework how time series data is stored, and remove the "conversion" intermediary step. More specifically:

  • Frozen state is also reworked and unified under a single DataStore struct.
  • We now store data in a SoA format to reduce duplication of time values, with a lot of the time series data logic stored in a separate crate (https://github.com/ClementTsang/timeless)
  • Remove the conversion steps and ConvertedData intermediary struct (and remove that altogether); we now have more direct access of the raw data.
  • Some other driveby changes:
    • Remove temperature conversion step and do it in data eating.

This has the following benefits:

  • Lower memory usage (since we're not duplicating as much data anymore)
  • Simpler/less code going from intaking data -> displaying data
  • A bit less spaghetti around accessing data
  • Less spaghetti around time series data

TODO:

  • Convert time graph draw to take iterators
    • Remove temporary point "caching"
    • Remove old glue code
  • Optimize table data loading such that it does no additional work
  • (maybe separate PR) Optimize table data loading to store references instead
  • Check any remaining FIXMEs.
  • Profile for any hotspots.

Issue

If applicable, what issue does this address?

Closes: #

Testing

If relevant, please state how this was tested. All changes must be tested to work:

If this is a code change, please also indicate which platforms were tested:

  • Windows
  • macOS
  • Linux

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, doc pages, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts
  • If relevant, new tests were added (don't worry too much about coverage)

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 59.28237% with 522 lines in your changes missing coverage. Please review.

Project coverage is 54.11%. Comparing base (cf91c73) to head (12f831b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/canvas/widgets/network_graph.rs 61.73% 88 Missing ⚠️
src/canvas/widgets/cpu_basic.rs 0.00% 83 Missing ⚠️
src/app/data/time_series.rs 35.24% 79 Missing ⚠️
src/canvas/widgets/mem_basic.rs 0.00% 67 Missing ⚠️
src/app/data/store.rs 83.87% 30 Missing ⚠️
src/utils/data_units.rs 39.02% 25 Missing ⚠️
.../canvas/components/time_graph/time_chart/points.rs 66.19% 24 Missing ⚠️
src/app.rs 44.11% 19 Missing ⚠️
src/canvas/widgets/mem_graph.rs 83.67% 16 Missing ⚠️
src/canvas/widgets/network_basic.rs 0.00% 12 Missing ⚠️
... and 17 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1663      +/-   ##
==========================================
+ Coverage   53.95%   54.11%   +0.16%     
==========================================
  Files         109      110       +1     
  Lines       17911    17540     -371     
==========================================
- Hits         9663     9491     -172     
+ Misses       8248     8049     -199     
Flag Coverage Δ
macos-14 37.62% <12.31%> (+0.26%) ⬆️
ubuntu-latest 56.50% <59.84%> (+0.17%) ⬆️
windows-2019 37.52% <12.20%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ClementTsang ClementTsang force-pushed the points_rework_v1 branch 2 times, most recently from a7f711b to 250f2b8 Compare January 20, 2025 22:23
@ClementTsang ClementTsang force-pushed the points_rework_v1 branch 2 times, most recently from 76cab2c to 7585d39 Compare January 25, 2025 06:39
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.

1 participant