-
Notifications
You must be signed in to change notification settings - Fork 539
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
Add heartbeat for usage collection and update to Loki 3.3 #4499
base: master
Are you sure you want to change the base?
Conversation
|
||
def __init__(self, interval_seconds: int = 600): | ||
super().__init__(constants.USAGE_MESSAGE_SCHEMA_VERSION) | ||
self.interval_seconds = interval_seconds |
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.
Is this variable used?
EVENT_INTERVAL_SECONDS = 600 | ||
|
||
def _run(self): | ||
usage_lib.send_heartbeat(interval_seconds=self.EVENT_INTERVAL_SECONDS) |
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.
a little bit curious why we need this interval seconds argument. Doesnt skylet already has a interval mechanism..?
Lines 46 to 56 in 061d4bd
def run(self): | |
self._n = (self._n + 1) % self._event_interval | |
if self._n % self._event_interval == 0: | |
logger.debug(f'{self.__class__.__name__} triggered') | |
try: | |
self._run() | |
except Exception as e: # pylint: disable=broad-except | |
# Keep the skylet running even if an event fails. | |
logger.error(f'{self.__class__.__name__} error: {e}') | |
with ux_utils.enable_traceback(): | |
logger.error(traceback.format_exc()) |
Tested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh