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

[Conditionals] Increase performance, switch to TelemetryCollections #7841

Merged
merged 31 commits into from
Oct 2, 2024

Conversation

jvigliotta
Copy link
Contributor

@jvigliotta jvigliotta commented Sep 12, 2024

Closes #7840

Believe this may be the issue reported in: VIPERGC-550

Describe your changes:

Add some performance enhancements to conditional styling. Switched to TelemetryCollections from older and separate subscribe and historical request. This prevents situations where different telemetry was being evaluated in a condition vs the telemetry itself in the item being styled with the condition. This also just brings conditions in line with the rest of our code that uses TelemetryCollections.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 4 lines in your changes missing coverage. Please review.

Project coverage is 57.45%. Comparing base (43cc963) to head (45cbbe4).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...gins/plot/stackedPlot/mixins/objectStyles-mixin.js 66.66% 3 Missing ⚠️
src/plugins/condition/ConditionManager.js 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7841      +/-   ##
==========================================
+ Coverage   57.44%   57.45%   +0.01%     
==========================================
  Files         675      675              
  Lines       27325    27317       -8     
  Branches     2673     2673              
==========================================
- Hits        15697    15696       -1     
+ Misses      11292    11285       -7     
  Partials      336      336              
Flag Coverage Δ
e2e-ci 62.42% <85.71%> (+0.37%) ⬆️
e2e-full 41.87% <0.00%> (-10.31%) ⬇️
unit 49.30% <60.71%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
src/plugins/condition/ConditionManager.js 87.75% <94.73%> (-3.25%) ⬇️
...gins/plot/stackedPlot/mixins/objectStyles-mixin.js 85.10% <66.66%> (+0.79%) ⬆️

... and 14 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43cc963...45cbbe4. Read the comment docs.

@ozyx ozyx self-requested a review September 12, 2024 19:57
@ozyx ozyx added this to the Target:4.0.1 milestone Sep 12, 2024
ozyx
ozyx previously requested changes Sep 12, 2024
Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Nice work! and nice job cleaning up that wild style code. I have a couple of suggestions where we can further improve performance, and I have some other suggestions for readability improvements.

Also this needs test(s) 😛

btw this test is failing in ci: [chrome] › functional/plugins/styling/stackedPlotStyling.e2e.spec.js:159:3 › Stacked Plot styling › styling a child object of the flexible layout properly applies that style to only that child

src/plugins/condition/ConditionManager.js Outdated Show resolved Hide resolved
src/plugins/condition/ConditionManager.js Outdated Show resolved Hide resolved
src/plugins/condition/ConditionManager.js Show resolved Hide resolved
src/plugins/condition/ConditionManager.js Outdated Show resolved Hide resolved
src/plugins/condition/ConditionManager.js Show resolved Hide resolved
src/plugins/condition/ConditionManager.js Show resolved Hide resolved
src/plugins/plot/stackedPlot/mixins/objectStyles-mixin.js Outdated Show resolved Hide resolved
@jvigliotta jvigliotta added the pr:e2e:couchdb npm run test:e2e:couchdb label Sep 17, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Sep 17, 2024
@khalidadil
Copy link
Contributor

@ozyx was this change still under review? It touches some code in a file that I'm also working on (ConditionManager.js), so I want to get it merged into my branch when it's ready

@ozyx
Copy link
Contributor

ozyx commented Sep 19, 2024

@ozyx was this change still under review? It touches some code in a file that I'm also working on (ConditionManager.js), so I want to get it merged into my branch when it's ready

It just needs a test. So you can probably safely rebase onto this branch and then rebase onto master once you're ready to open a PR

…dling into the raf for consistency and performance
@jvigliotta jvigliotta self-assigned this Sep 30, 2024
@jvigliotta jvigliotta added the pr:e2e:couchdb npm run test:e2e:couchdb label Sep 30, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Sep 30, 2024
@jvigliotta jvigliotta added the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 1, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 1, 2024
Copy link
Collaborator

@unlikelyzero unlikelyzero left a comment

Choose a reason for hiding this comment

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

Updated the test

const style = await element.getAttribute('style');

// eslint-disable-next-line playwright/prefer-web-first-assertions
expect(style).toBe(expectedStyle);
Copy link
Collaborator

@unlikelyzero unlikelyzero Sep 25, 2024

Choose a reason for hiding this comment

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

There should be a new style checks api. I didn't have time to implement it

* @param {string} parameterName
* @param {string} objectName
*/
async function searchAndLinkParameterToObject(page, parameterName, objectName) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is a pre-promotion appAction. We're leveraging this in yamcsAppActions. I think it would be useful in core

let stateGenerator;
let conditionSet;
let displayLayout;
const STATE_CHANGE_INTERVAL = '1';
Copy link
Collaborator

Choose a reason for hiding this comment

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

this may need to change if the current test is flaky

@unlikelyzero unlikelyzero dismissed stale reviews from akhenry and ozyx October 1, 2024 03:41

addressed comments

@unlikelyzero unlikelyzero added the performance impacts or improves performance label Oct 1, 2024
@unlikelyzero unlikelyzero added the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 1, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 1, 2024
@akhenry
Copy link
Contributor

akhenry commented Oct 1, 2024

This issue was still evident in my testing -

conditional.styling.bug.mov

I actually think that the video does not show a bug at all. I think what it shows is an artifact of telemetry batching. We send batches of telemetry once per second from the WebSocket worker, and the condition set and TelemetryView just show the most recent value from the batch. Each window is a separate WebSocket, and a separate buffer initiated at a different time, so the latest value in each batch will be different, and that's fine. We're showing a real-time "snapshot" of the system to the user once-per second. If they want to see everything they can, in a table or a plot.

@ozyx ozyx added the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 2, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Oct 2, 2024
@ozyx ozyx merged commit 37b2660 into master Oct 2, 2024
23 checks passed
@ozyx ozyx deleted the conditional-style-performance branch October 2, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance impacts or improves performance type:enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Condition Manager is using older telemetry API and conditional styling can use a performance upgrade
5 participants