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

Do not aggregate node execution analytics anymore #11356

Merged
merged 3 commits into from
Dec 17, 2020

Conversation

QilongTang
Copy link
Contributor

@QilongTang QilongTang commented Dec 11, 2020

Please Note:

  1. Before submitting the PR, please review How to Contribute to Dynamo
  2. Dynamo Team will meet 1x a month to review PRs found on Github (Issues will be handled separately)
  3. PRs will be reviewed from oldest to newest
  4. If a reviewed PR requires changes by the owner, the owner of the PR has 30 days to respond. If the PR has seen no activity by the next session, it will be either closed by the team or depending on its utility will be taken over by someone on the team
  5. PRs should use either Dynamo's default PR template or one of these other template options in order to be considered for review.
  6. PRs that do not have one of the Dynamo PR templates completely filled out with all declarations satisfied will not be reviewed by the Dynamo team.
  7. PRs made to the DynamoRevit repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after a LGTM label is added to the PR.

Purpose

Example Graph
image

Previously, node execution analytics data was aggregated with comma, e.g.

Code Block, String from Array, Watch

This makes data much less straight forward on backend with all kinds of combos of modified nodes during execution.

After this PR, each executed node will be tracked individually and no longer using timed event. Here are the cases:

  1. Adding a new node, ModifiedNodes only contains the new node
  2. Deleting a node, depending on which node we are deleting, ModifiedNodes only contains the downstream subgraph
  3. Moving a node, no graph run will be triggered
  4. Undo moving a node, ModifiedNodes only contains the node moved and downstream subgraph. This is a bug tracked.
  5. Modifying a node, ModifiedNodes only contains the node modified and downstream subgraph

Individual node execution event will be tracked as DYN.NodeOperations.Run instead of the previous aggregated DYN.Performance.UpdateGraphAsyncTask. See related PR: https://git.autodesk.com/Dynamo/Analytics.NET/pull/26

About performance impact, I used DotTrace by Jetbrains to profile with a file with ~760 nodes, I did file opening and some other actions above which would trigger rerun with a lot of nodes executed. The profiling results did not mark any hot spots on analytics call but marked Python node view customization as hot spots. Since the analytics call do not involve system I/O by default which matches my expectation, I think adding this loop should be safe. FYI: @mmisol
image

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Reviewers

@DynamoDS/dynamo

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

Categories.Performance,
e.Task.GetType().Name,
executionTimeSpan, node.GetOriginalName());
}
Copy link
Contributor Author

@QilongTang QilongTang Dec 11, 2020

Choose a reason for hiding this comment

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

@mmisol @aparajit-pratap Thank you for your input. I would like to take more time to think through how we track real changes to nodes executed.

From what I can tell, adding/deleting/undo moving/modifying a node will all trigger execution so even a node showing as popularly executed, it might be just users modify them regularly.. Like Code Block node

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Certain cases, undo/redo may trigger multiple runs..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also @mmisol I dont think I can only look for ModifiedNodes.count = 1 case because when upstream node modified, we usually make downstream nodes dirty as well in Dynamo. e.g. with the following example, if user touches CBN, the all three nodes will be in ModifiedNodes set during execution.. Maybe the ModifiedNodes name itself is misleading..
image

Copy link
Member

Choose a reason for hiding this comment

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

maybe a stupid question... doesn't this send n http requests for each graph run? Doesn't that seem potentially slow with large graphs?

Copy link
Contributor Author

@QilongTang QilongTang Dec 16, 2020

Choose a reason for hiding this comment

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

@mjkkirschner ADPSDK will handle the requests with optimization on their end. From my dottrace profiling, this do not seem impact Dynamo performance that much. I have a screen shot of that in PR description using DotTrace. Also, since delta computation works, we are not always sending n requests for each run, but only the downstream subset of the graph.

@QilongTang
Copy link
Contributor Author

I looked at this change with @aparajit-pratap together and found it works great without Tuneup view extension, I will try to do some profiling to estimate the performance impact.

@QilongTang QilongTang marked this pull request as ready for review December 14, 2020 17:12
Copy link
Contributor

@zeusongit zeusongit left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@mmisol mmisol left a comment

Choose a reason for hiding this comment

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

Just a couple of questions on my end. Maybe my comment in #11355 was misunderstood because I didn't say I had concerns about performance.

Actions.Run,
Categories.NodeOperations,
node.GetOriginalName());
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see this is not a timed event anymore, which makes sense to me given we cannot separate the individual execution time for each node. Just checking if this was an intended change since it wasn't announced in the description @QilongTang

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks,yes it is intended and let me update description

foreach (var node in updateTask.ModifiedNodes)
{
// Starting from Dynamo 2.11.0, tracking node execution as generic event so
// it is distinguished with the previous aggregated performance event
Copy link
Collaborator

@mmisol mmisol Dec 17, 2020

Choose a reason for hiding this comment

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

Regarding this comment, I would abstain from including Starting from Dynamo 2.11.0,. Since we are using git it's easy to traceback changes without having to add timestamps or version marks.

@QilongTang
Copy link
Contributor Author

@mmisol Thanks for review, Addressed the comments, updated PR description and merging.

@QilongTang QilongTang merged commit d812d26 into master Dec 17, 2020
@QilongTang QilongTang deleted the ExecutedNodesAnalytics branch December 17, 2020 16:34
QilongTang added a commit that referenced this pull request Jan 27, 2021
* Do not aggregate node execution analytics anymore

* Update to use new event combo

* Update Comments
@QilongTang QilongTang mentioned this pull request Jan 27, 2021
8 tasks
QilongTang added a commit that referenced this pull request Jan 28, 2021
* Dock and Undock view extension with Dynamic extension ID as edge case (#11394)

* Initial Commit with settings null check

* Add unit test

* Add view extension loading warning

* Update message

* Initial Commit (#11366)

* Do not aggregate node execution analytics anymore (#11356)

* Do not aggregate node execution analytics anymore

* Update to use new event combo

* Update Comments

* Make IntegerSlider the only AKA for migration (#11360)

There were two classes that were declaring an 'AlsoKnownAs' attribute
for 'DSCoreNodesUI.Input.IntegerSlider' in 'CoreNodeModels.Input':
'IntegerSlider' and 'IntegerSlider64Bit'. While the latter obsoletes
the former, it is not possible to migrate to it from XML, so only 
'IntegerSlider' should continue declaring an 'AlsoKnownAs' attribute.
Note that currently both classes are trying to be registered, which
results in only one of them being registered but not really making any
guarantees of which one it is. This also generates an exception catched
internally but shown in the console.

* Revised icons for AnyTrue and AnyFalse nodes (#11361)

* Implement ToString for DS Dictionary (#11358)

This is done to provide meaningful output when a dictionary is provided
to nodes like 'String from Array' and 'String from Object'. These nodes
call built-in DS functions that end up calling ToString on the
dictionary, which until now used the default implementation inherited
from Object which just returned the class name.

Co-authored-by: Martin Misol Monzo <[email protected]>
Co-authored-by: Laurence Elsdon <[email protected]>
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.

5 participants