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

DYN-1899: Node Execution Events #9823

Merged
merged 30 commits into from
Jul 1, 2019
Merged

Conversation

ColinDayOrg
Copy link
Contributor

@ColinDayOrg ColinDayOrg commented Jul 1, 2019

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

This PR adds the ability to fire events at the beginning and end of node execution when profiling.

Declarations

Check these if you believe they are true

  • The code base 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.

Reviewers

@mjkkirschner

@ColinDayOrg ColinDayOrg requested a review from mjkkirschner July 1, 2019 14:09
@@ -135,6 +135,38 @@ private void OnDispatchedToUI(object sender, UIDispatcherEventArgs e)
/// </summary>
public event Action<PortModel> PortDisconnected;

public class NodeExecutionEventArgs : EventArgs
Copy link
Member

Choose a reason for hiding this comment

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

all the public properties and the class itself should have some ///summary tags please.

}

/// <summary>
/// Event triggered before a node is executed.
Copy link
Member

Choose a reason for hiding this comment

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

I think this comment should indicate that these events are only fired when profiling is enabled.

Copy link
Member

Choose a reason for hiding this comment

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

alternatively we could rename them to be less general.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Notes have been added to both events to indicate that they will only be fired when profiling is turned on. My thought is that the names should remain general in the case that it is decided to make the event firing non-dependent on profiling being turned on so to not break the API.


internal void OnNodeExecutionBegin(object data)
{
NodeExecutionBegin?.Invoke(this, new NodeExecutionEventArgs(this, data));
Copy link
Member

@mjkkirschner mjkkirschner Jul 1, 2019

Choose a reason for hiding this comment

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

it appears this passes the nodes evaluated output to this handler?
Can you confirm that in one of the tests?
To clarify, I mean, what is data here?

}

[Test]
public void TestNodeExecutionEvents()
Copy link
Member

Choose a reason for hiding this comment

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

can we add test that asserts the value of the data object? Or get rid of that property if we think it should not be passed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After looking into the tests for the data object it seemed to me that the data object was redundant because the NodeModel object was the important information which was already being passed in. I removed the class that contained the NodeModel GUID and the now extraneous data and just rely on the NodeModel object that was being passed through already.

@mjkkirschner
Copy link
Member

LGTM

@QilongTang
Copy link
Contributor

LGTM but what's up with so many merge commits..

@ColinDayOrg
Copy link
Contributor Author

I'm not sure about the number of merge commits. If there is a way to squash them please let me know. The only thing I have heard is that I should delete my fork and re-create it, but it seems to me that there should be a better way to do it.

@ColinDayOrg ColinDayOrg merged commit fb4916a into DynamoDS:master Jul 1, 2019
QilongTang pushed a commit that referenced this pull request Jul 3, 2019
* Update changes from librarie.js to fix QNTM-3710

* Add new events and tests

* Remove unnecessary arguments

* Remove unneeded arguments
ColinDayOrg pushed a commit that referenced this pull request Jul 3, 2019
* Update changes from librarie.js to fix QNTM-3710

* Add new events and tests

* Remove unnecessary arguments

* Remove unneeded arguments
mjkkirschner pushed a commit that referenced this pull request Aug 3, 2019
* Update changes from librarie.js to fix QNTM-3710

* Add new events and tests

* Remove unnecessary arguments

* Remove unneeded arguments
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.

3 participants