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

Avoid WMISampler inheriting from Thread #4051

Merged
merged 3 commits into from
Jul 5, 2019

Conversation

AlexandreYang
Copy link
Member

@AlexandreYang AlexandreYang commented Jul 5, 2019

What does this PR do?

Avoid WMISampler inheriting from Thread.

Improvement to this PR: https://github.com/DataDog/integrations-core/pull/3987/files

Revert this PR: #4043

Motivation

No need to inherit Thread.

See also: #3987 (comment)

Additional Notes

/

Review checklist (to be filled by reviewers)

  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached
  • Feature or bugfix must have tests
  • Git history must be clean
  • If PR adds a configuration option, it must be added to the configuration file.

self.start()
thread = Thread(target=self._query_sample_loop, name=class_name)
thread.daemon = True
thread.start()
Copy link
Member Author

Choose a reason for hiding this comment

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

@AlexandreYang AlexandreYang marked this pull request as ready for review July 5, 2019 14:20
@AlexandreYang AlexandreYang requested review from a team as code owners July 5, 2019 14:20
@AlexandreYang AlexandreYang requested review from ofek and therve July 5, 2019 14:22
self.start()
thread = Thread(target=self._query_sample_loop, name=class_name)
thread.daemon = True
thread.start()
Copy link
Member Author

Choose a reason for hiding this comment

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

Starting a thread in the __init__ feels not great. Let me know if you know a better way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Start it in sample the first time is called?

Copy link
Member Author

Choose a reason for hiding this comment

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

Would make the code a bit more complex though, one more flag to manage.

@AlexandreYang AlexandreYang merged commit ebe82a0 into master Jul 5, 2019
@AlexandreYang AlexandreYang deleted the alex/refactor_wmi_sampler branch July 16, 2019 11:42
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