-
Notifications
You must be signed in to change notification settings - Fork 3
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
Profile code #19
base: master
Are you sure you want to change the base?
Profile code #19
Conversation
payload, state = self.transform_data(content) | ||
#Todo Make this atomic if after sending -> Ctrl - C happens then it fails to save state |
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.
why are we removing existing comments ?
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.
Have restore the comments
self.log.info(f'''No results window LogType: {log_type} kwargs: {kwargs} status: {fetch_success}''') | ||
is_move_fetch_window, new_state = self.check_move_fetch_window(kwargs) | ||
if is_move_fetch_window: | ||
self.save_state(**new_state) | ||
self.log.debug(f'''Moving fetched window newstate: {new_state}''') | ||
else: | ||
self.log.error(f'''Error LogType: {log_type} status: {fetch_success} reason: {content}''') | ||
except Exception as e: |
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.
remove try and except, the exceptions should be propagated to base class where these are caught.
sumomongodbatlascollector/api.py
Outdated
|
||
msg['project_id'] = self.api_config['PROJECT_ID'] |
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.
revert back this change, the older if conditions were there for different mongodb versions which have different log format.
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.
use separate commits for fixing indentatins / cosmetic changes
and changes needed for improving memory footprint.
Also describe the changes done to improve the memory footprint and how much it improved.
Have added the profiling code for the classes and methods of the api and the main file. The code profiles each line of each of the function and generates html (flamegraph profile) for each of the functions.