-
Notifications
You must be signed in to change notification settings - Fork 47
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
Threaded telemetry #436
Open
AdrianSosic
wants to merge
17
commits into
main
Choose a base branch
from
feature/threaded_telemetry
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+375
−262
Open
Threaded telemetry #436
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
cb64a78
Move telemetry code to own subpackage
AdrianSosic cc1a6e2
Use existing is_enable utility
AdrianSosic e2cf05f
Remove dead code
AdrianSosic d62b087
Split code into public and private parts
AdrianSosic 9a1af1d
Add class for lazy loading of telemetry objects
AdrianSosic 0771897
Move constants to top level
AdrianSosic 417e0e4
Add transmission queue
AdrianSosic 7b3b0a7
Extract connection test into function
AdrianSosic 895dd2c
Transmit telemetry events from daeman thread
AdrianSosic d7d30af
Start the daemon only when connection test is successful
AdrianSosic f5c3cad
Run connection test from daemon thread
AdrianSosic e4f3512
Suppress mypy warning for lazy attribute
AdrianSosic 671832d
Drop unused constants
AdrianSosic 2440d73
Polish docstrings
AdrianSosic 4e4fdb9
Close queue immediately when telemetry is deactivated
AdrianSosic 8a5e1ef
Print telemetry warning only for developers
AdrianSosic 201b52c
Update CHANGELOG.md
AdrianSosic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"""Telemetry functionality for BayBE. | ||
|
||
For more details, see https://emdgroup.github.io/baybe/stable/userguide/envvars.html#telemetry | ||
""" | ||
|
||
from baybe.telemetry.api import ( | ||
TELEM_LABELS, | ||
VARNAME_TELEMETRY_ENABLED, | ||
VARNAME_TELEMETRY_HOSTNAME, | ||
VARNAME_TELEMETRY_USERNAME, | ||
telemetry_record_recommended_measurement_percentage, | ||
telemetry_record_value, | ||
) | ||
|
||
__all__ = [ | ||
"TELEM_LABELS", | ||
"VARNAME_TELEMETRY_ENABLED", | ||
"VARNAME_TELEMETRY_HOSTNAME", | ||
"VARNAME_TELEMETRY_USERNAME", | ||
"telemetry_record_recommended_measurement_percentage", | ||
"telemetry_record_value", | ||
] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turning your comment into a thread:
TBH, it's hard for me to exactly explain the problem. All I can say: I can't reproduce it at home, but I regularly encounter the problem on the train, probably during the moments where the mobile connection is slow / lost. So my mac still "sees" a connection, but can't reach then endpoint. And the process is always the same:
So the problem is not telemetry itself but some of our code parts that are blocking. I can try to reproduce and figure out next time I'm on the train and run into the problem.
But regardless of whether we keep the threading approach or not, we can still leverage some of the improvements of this PR, i.e. deletion of dead code, lazy telemetry loading, cleanup into small functions, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not being able to reproduce and not knowing the exact source of the issue, were you already able to verify the new solution fixes your issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I think it cannot "not" fix the issue since there is no nothing left that could be blocking. At least in principle, the entire execution of the original
telemetry.py
was in the main thread, so whatever happened there would block the further execution of the baybe code (not talking about the actual telemetry calls but the pure import of the module). This is now all gone.But we can delay the discussion until I have more evidence, if you prefer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really dont like this approach
coding auf sicht
if you know the issue we can merge without test, based on clearly seeing the cause being fixed in the code
if we dont know the code its not even clear any of the code in this PR addresses anything relevant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo, this should be discussed in our meeting instead of here.